mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
vulkan: docs annotation updates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1506>
This commit is contained in:
parent
bc95b5d99a
commit
2d31aba78d
61 changed files with 1443 additions and 328 deletions
|
@ -222748,133 +222748,6 @@
|
|||
"filename": "gstvulkan",
|
||||
"license": "LGPL",
|
||||
"other-types": {
|
||||
"GstVulkanDevice": {
|
||||
"hierarchy": [
|
||||
"GstVulkanDevice",
|
||||
"GstObject",
|
||||
"GInitiallyUnowned",
|
||||
"GObject"
|
||||
],
|
||||
"kind": "object",
|
||||
"properties": {
|
||||
"instance": {
|
||||
"blurb": "Associated Vulkan Instance",
|
||||
"conditionally-available": false,
|
||||
"construct": false,
|
||||
"construct-only": false,
|
||||
"controllable": false,
|
||||
"mutable": "null",
|
||||
"readable": true,
|
||||
"type": "GstVulkanInstance",
|
||||
"writable": false
|
||||
},
|
||||
"physical-device": {
|
||||
"blurb": "Associated Vulkan Physical Device",
|
||||
"conditionally-available": false,
|
||||
"construct": false,
|
||||
"construct-only": true,
|
||||
"controllable": false,
|
||||
"mutable": "null",
|
||||
"readable": true,
|
||||
"type": "GstVulkanPhysicalDevice",
|
||||
"writable": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"GstVulkanInstance": {
|
||||
"hierarchy": [
|
||||
"GstVulkanInstance",
|
||||
"GstObject",
|
||||
"GInitiallyUnowned",
|
||||
"GObject"
|
||||
],
|
||||
"kind": "object",
|
||||
"properties": {
|
||||
"requested-api-major": {
|
||||
"blurb": "Major version of the requested Vulkan API (0 = maximum supported)",
|
||||
"conditionally-available": false,
|
||||
"construct": false,
|
||||
"construct-only": false,
|
||||
"controllable": false,
|
||||
"default": "0",
|
||||
"max": "-1",
|
||||
"min": "0",
|
||||
"mutable": "null",
|
||||
"readable": true,
|
||||
"type": "guint",
|
||||
"writable": true
|
||||
},
|
||||
"requested-api-minor": {
|
||||
"blurb": "Minor version of the requested Vulkan API",
|
||||
"conditionally-available": false,
|
||||
"construct": false,
|
||||
"construct-only": false,
|
||||
"controllable": false,
|
||||
"default": "0",
|
||||
"max": "-1",
|
||||
"min": "0",
|
||||
"mutable": "null",
|
||||
"readable": true,
|
||||
"type": "guint",
|
||||
"writable": true
|
||||
}
|
||||
},
|
||||
"signals": {
|
||||
"create-device": {
|
||||
"args": [],
|
||||
"return-type": "GstVulkanDevice",
|
||||
"when": "last"
|
||||
}
|
||||
}
|
||||
},
|
||||
"GstVulkanPhysicalDevice": {
|
||||
"hierarchy": [
|
||||
"GstVulkanPhysicalDevice",
|
||||
"GstObject",
|
||||
"GInitiallyUnowned",
|
||||
"GObject"
|
||||
],
|
||||
"kind": "object",
|
||||
"properties": {
|
||||
"device-index": {
|
||||
"blurb": "Device Index",
|
||||
"conditionally-available": false,
|
||||
"construct": false,
|
||||
"construct-only": true,
|
||||
"controllable": false,
|
||||
"default": "0",
|
||||
"max": "-1",
|
||||
"min": "0",
|
||||
"mutable": "null",
|
||||
"readable": true,
|
||||
"type": "guint",
|
||||
"writable": true
|
||||
},
|
||||
"instance": {
|
||||
"blurb": "Associated Vulkan Instance",
|
||||
"conditionally-available": false,
|
||||
"construct": false,
|
||||
"construct-only": true,
|
||||
"controllable": false,
|
||||
"mutable": "null",
|
||||
"readable": true,
|
||||
"type": "GstVulkanInstance",
|
||||
"writable": true
|
||||
},
|
||||
"name": {
|
||||
"blurb": "Device Name",
|
||||
"conditionally-available": false,
|
||||
"construct": false,
|
||||
"construct-only": false,
|
||||
"controllable": false,
|
||||
"default": "",
|
||||
"mutable": "null",
|
||||
"readable": true,
|
||||
"type": "gchararray",
|
||||
"writable": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"GstVulkanStereoDownmix": {
|
||||
"kind": "enum",
|
||||
"values": [
|
||||
|
@ -222894,17 +222767,6 @@
|
|||
"value": "2"
|
||||
}
|
||||
]
|
||||
},
|
||||
"GstVulkanVideoFilter": {
|
||||
"hierarchy": [
|
||||
"GstVulkanVideoFilter",
|
||||
"GstBaseTransform",
|
||||
"GstElement",
|
||||
"GstObject",
|
||||
"GInitiallyUnowned",
|
||||
"GObject"
|
||||
],
|
||||
"kind": "object"
|
||||
}
|
||||
},
|
||||
"package": "GStreamer Bad Plug-ins",
|
||||
|
|
|
@ -149,10 +149,6 @@ gst_vulkan_sink_class_init (GstVulkanSinkClass * klass)
|
|||
gst_element_class_add_static_pad_template (element_class,
|
||||
&gst_vulkan_sink_template);
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_VULKAN_DEVICE, 0);
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_VULKAN_PHYSICAL_DEVICE, 0);
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_VULKAN_INSTANCE, 0);
|
||||
|
||||
gobject_class->finalize = gst_vulkan_sink_finalize;
|
||||
|
||||
gstelement_class->change_state = gst_vulkan_sink_change_state;
|
||||
|
|
|
@ -21,6 +21,9 @@
|
|||
#ifndef __GST_VULKAN_API_H__
|
||||
#define __GST_VULKAN_API_H__
|
||||
|
||||
/**
|
||||
* VK_PROTOTYPES: (attributes doc.skip=true)
|
||||
*/
|
||||
#define VK_PROTOTYPES
|
||||
|
||||
#include <gst/vulkan/gstvkconfig.h>
|
||||
|
|
|
@ -26,6 +26,15 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GstVulkanBarrierType:
|
||||
* @GST_VULKAN_BARRIER_NONE: no barrier type
|
||||
* @GST_VULKAN_BARRIER_MEMORY: memory barrier
|
||||
* @GST_VULKAN_BARRIER_BUFFER: buffer barrier
|
||||
* @GST_VULKAN_BARRIER_IMAGE: image barrier
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GST_VULKAN_BARRIER_NONE = 0,
|
||||
|
@ -34,11 +43,27 @@ typedef enum
|
|||
GST_VULKAN_BARRIER_TYPE_IMAGE = 3,
|
||||
} GstVulkanBarrierType;
|
||||
|
||||
/**
|
||||
* GstVulkanBarrierFlags:
|
||||
* @GST_VULKAN_BARRIER_FLAGS_NONE: no flags
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GST_VULKAN_BARRIER_FLAG_NONE = 0,
|
||||
} GstVulkanBarrierFlags;
|
||||
|
||||
/**
|
||||
* GstVulkanBarrierMemoryInfo:
|
||||
* @type: the #GstVulkanBarrierType of the barrier
|
||||
* @flags the #GstVulkanBarrierFlags of the barrier
|
||||
* @queue: the #GstVulkanQueue this barrier is to execute with
|
||||
* @pipeline_stages: the stages in the graphics pipeline to execute the barrier
|
||||
* @access_flags: access flags
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBarrierMemoryInfo
|
||||
{
|
||||
GstVulkanBarrierType type;
|
||||
|
@ -46,6 +71,9 @@ struct _GstVulkanBarrierMemoryInfo
|
|||
GstVulkanQueue * queue;
|
||||
VkPipelineStageFlags pipeline_stages;
|
||||
VkAccessFlags access_flags;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -300,7 +300,7 @@ gst_vulkan_buffer_memory_alloc (GstVulkanDevice * device, gsize size,
|
|||
/**
|
||||
* gst_vulkan_buffer_memory_wrapped:
|
||||
* @device: a #GstVulkanDevice
|
||||
* @buffer: a #VkBuffer
|
||||
* @buffer: a `VkBuffer`
|
||||
* @usage: usage flags of @buffer
|
||||
* @user_data: (allow-none): user data to call @notify with
|
||||
* @notify: (allow-none): a #GDestroyNotify called when @buffer is no longer in use
|
||||
|
|
|
@ -39,12 +39,34 @@ GType gst_vulkan_buffer_memory_allocator_get_type(void);
|
|||
#define GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanBufferMemoryAllocatorClass))
|
||||
#define GST_VULKAN_BUFFER_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanBufferMemoryAllocator))
|
||||
#define GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanBufferMemoryAllocatorClass))
|
||||
/**
|
||||
* GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_CAST(obj) ((GstVulkanBufferMemoryAllocator *)(obj))
|
||||
|
||||
/**
|
||||
* GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_NAME:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_BUFFER_MEMORY_ALLOCATOR_NAME "VulkanBuffer"
|
||||
/**
|
||||
* GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_CAPS_FEATURE_MEMORY_VULKAN_BUFFER "memory:VulkanBuffer"
|
||||
|
||||
|
||||
/**
|
||||
* GstVulkanBarrierBufferInfo:
|
||||
* @parent: parent #GstVulkanBarrierMemoryInfo
|
||||
* @offset: offset into the vulkan buffer to execute the barrier with
|
||||
* @size: size of memory to execute barrier over
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBarrierBufferInfo
|
||||
{
|
||||
GstVulkanBarrierMemoryInfo parent;
|
||||
|
@ -52,7 +74,18 @@ struct _GstVulkanBarrierBufferInfo
|
|||
VkDeviceSize offset;
|
||||
VkDeviceSize size;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanBufferMemory:
|
||||
* @parent: parent #GstMemory
|
||||
* @device: the #GstVulkanDevice this vulkan buffer is allocated from
|
||||
* @buffer: Vulkan buffer object
|
||||
* @vk_mem: backing #GstVulkanMemory for @buffer
|
||||
* @requirements: allocation requirements for @buffer
|
||||
* @usage: intended usage for @buffer
|
||||
* @barrier: the last set barrier information
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBufferMemory
|
||||
{
|
||||
GstMemory parent;
|
||||
|
@ -67,6 +100,7 @@ struct _GstVulkanBufferMemory
|
|||
|
||||
GstVulkanBarrierBufferInfo barrier;
|
||||
|
||||
/* <private> */
|
||||
GMutex lock;
|
||||
gboolean wrapped;
|
||||
GDestroyNotify notify;
|
||||
|
@ -75,22 +109,34 @@ struct _GstVulkanBufferMemory
|
|||
|
||||
/**
|
||||
* GstVulkanBufferMemoryAllocator
|
||||
* @parent: the parent #GstAllocator
|
||||
*
|
||||
* Opaque #GstVulkanBufferMemoryAllocator struct
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBufferMemoryAllocator
|
||||
{
|
||||
GstAllocator parent;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanBufferMemoryAllocatorClass:
|
||||
* @parent_class: the parent #GstAllocatorClass
|
||||
*
|
||||
* The #GstVulkanBufferMemoryAllocatorClass only contains private data
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBufferMemoryAllocatorClass
|
||||
{
|
||||
GstAllocatorClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -34,28 +34,46 @@ GType gst_vulkan_buffer_pool_get_type (void);
|
|||
#define GST_TYPE_VULKAN_BUFFER_POOL (gst_vulkan_buffer_pool_get_type())
|
||||
#define GST_IS_VULKAN_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_BUFFER_POOL))
|
||||
#define GST_VULKAN_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_BUFFER_POOL, GstVulkanBufferPool))
|
||||
/**
|
||||
* GST_VULKAN_BUFFER_POOL_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_BUFFER_POOL_CAST(obj) ((GstVulkanBufferPool*)(obj))
|
||||
|
||||
/**
|
||||
* GstVulkanBufferPool:
|
||||
* @bufferpool: the parent #GstBufferPool
|
||||
* @device: the #GstVulkanDevice to allocate Vulkan buffers from
|
||||
*
|
||||
* Opaque GstVulkanBufferPool struct
|
||||
* Opaque #GstVulkanBufferPool struct
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBufferPool
|
||||
{
|
||||
GstBufferPool bufferpool;
|
||||
|
||||
GstVulkanDevice *device;
|
||||
|
||||
/* <private> */
|
||||
gpointer _padding[GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanBufferPoolClass:
|
||||
* @parent_class: the parent #GstBufferPoolClass
|
||||
*
|
||||
* The #GstVulkanBufferPoolClass structure contains only private data
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBufferPoolClass
|
||||
{
|
||||
GstBufferPoolClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _padding[GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
|
||||
/**
|
||||
* SECTION:vulkancommandbuffer
|
||||
* @title: vulkancommandbuffer
|
||||
* @title: GstVulkanCommandBuffer
|
||||
* @short_description: Vulkan command buffer
|
||||
* @see_also: #GstVulkanCommandPool
|
||||
*
|
||||
* vulkancommandbuffer holds information about a command buffer.
|
||||
*/
|
||||
|
@ -97,6 +99,8 @@ gst_vulkan_command_buffer_init (GstVulkanCommandBuffer * cmd,
|
|||
* @level: the VkCommandBufferLevel for @cmd
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanCommandBuffer
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanCommandBuffer *
|
||||
gst_vulkan_command_buffer_new_wrapped (VkCommandBuffer cmd,
|
||||
|
|
|
@ -28,12 +28,31 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* gst_vulkan_command_buffer_get_type:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_command_buffer_get_type (void);
|
||||
/**
|
||||
* GST_TYPE_VULKAN_COMMAND_BUFFER:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_TYPE_VULKAN_COMMAND_BUFFER (gst_vulkan_command_buffer_get_type ())
|
||||
|
||||
typedef struct _GstVulkanCommandBuffer GstVulkanCommandBuffer;
|
||||
|
||||
/**
|
||||
* GstVulkanCommandBuffer:
|
||||
* @parent: the parent #GstMiniObject
|
||||
* @cmd: the vulkan command buffer handle
|
||||
* @pool: the parent #GstVulkanCommandPool for command buffer reuse and locking
|
||||
* @level: the level of the vulkan command buffer
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanCommandBuffer
|
||||
{
|
||||
GstMiniObject parent;
|
||||
|
@ -44,7 +63,8 @@ struct _GstVulkanCommandBuffer
|
|||
GstVulkanCommandPool *pool;
|
||||
VkCommandBufferLevel level;
|
||||
|
||||
GMutex lock;
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -53,7 +73,9 @@ struct _GstVulkanCommandBuffer
|
|||
*
|
||||
* Increases the refcount of the given buffer by one.
|
||||
*
|
||||
* Returns: (transfer full): @buf
|
||||
* Returns: (transfer full): @cmd
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline GstVulkanCommandBuffer* gst_vulkan_command_buffer_ref(GstVulkanCommandBuffer* cmd);
|
||||
static inline GstVulkanCommandBuffer *
|
||||
|
@ -68,6 +90,8 @@ gst_vulkan_command_buffer_ref (GstVulkanCommandBuffer * cmd)
|
|||
*
|
||||
* Decreases the refcount of the buffer. If the refcount reaches 0, the buffer
|
||||
* will be freed.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline void gst_vulkan_command_buffer_unref(GstVulkanCommandBuffer* cmd);
|
||||
static inline void
|
||||
|
@ -82,13 +106,13 @@ gst_vulkan_command_buffer_unref (GstVulkanCommandBuffer * cmd)
|
|||
*
|
||||
* Clears a reference to a #GstVulkanCommandBuffer.
|
||||
*
|
||||
* @buf_ptr must not be %NULL.
|
||||
* @cmd_ptr must not be %NULL.
|
||||
*
|
||||
* If the reference is %NULL then this function does nothing. Otherwise, the
|
||||
* reference count of the command buffer is decreased and the pointer is set
|
||||
* to %NULL.
|
||||
*
|
||||
* Since: 1.16
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline void
|
||||
gst_clear_vulkan_command_buffer (GstVulkanCommandBuffer ** cmd_ptr)
|
||||
|
@ -96,7 +120,25 @@ gst_clear_vulkan_command_buffer (GstVulkanCommandBuffer ** cmd_ptr)
|
|||
gst_clear_mini_object ((GstMiniObject **) cmd_ptr);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_command_buffer_lock:
|
||||
* @cmd: the #GstVulkanCommandBuffer
|
||||
*
|
||||
* Lock @cmd for writing cmmands to @cmd. Must be matched by a corresponding
|
||||
* gst_vulkan_command_buffer_unlock().
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define gst_vulkan_command_buffer_lock(cmd) (gst_vulkan_command_pool_lock((cmd)->pool))
|
||||
/**
|
||||
* gst_vulkan_command_buffer_unlock:
|
||||
* @cmd: the #GstVulkanCommandBuffer
|
||||
*
|
||||
* Unlock @cmd for writing cmmands to @cmd. Must be matched by a corresponding
|
||||
* gst_vulkan_command_buffer_lock().
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define gst_vulkan_command_buffer_unlock(cmd) (gst_vulkan_command_pool_unlock((cmd)->pool))
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
* SECTION:vkcommandpool
|
||||
* @title: GstVulkanCommandPool
|
||||
* @short_description: Vulkan command pool
|
||||
* @see_also: #GstVulkanDevice
|
||||
* @see_also: #GstVulkanCommandBuffer, #GstVulkanDevice
|
||||
*/
|
||||
|
||||
#define GST_VULKAN_COMMAND_POOL_LARGE_OUTSTANDING 1024
|
||||
|
@ -242,6 +242,8 @@ gst_vulkan_command_pool_release_buffer (GstVulkanCommandPool * pool,
|
|||
* gst_vulkan_command_pool_lock()/gst_vulkan_command_pool_unlock() pair to meet
|
||||
* the Vulkan API requirements that host access to the command pool is
|
||||
* externally synchronised.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_command_pool_lock (GstVulkanCommandPool * pool)
|
||||
|
@ -258,6 +260,8 @@ gst_vulkan_command_pool_lock (GstVulkanCommandPool * pool)
|
|||
*
|
||||
* See the documentation for gst_vulkan_command_pool_lock() for when you would
|
||||
* need to use this function.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_command_pool_unlock (GstVulkanCommandPool * pool)
|
||||
|
|
|
@ -32,6 +32,14 @@
|
|||
GST_VULKAN_API
|
||||
GType gst_vulkan_command_pool_get_type (void);
|
||||
|
||||
/**
|
||||
* GstVulkanCommandPool:
|
||||
* @parent: the parent #GstObject
|
||||
* @queue: the #GstVulkanQueue to command buffers will be allocated from
|
||||
* @pool: the vulkan command pool handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanCommandPool
|
||||
{
|
||||
GstObject parent;
|
||||
|
@ -39,11 +47,23 @@ struct _GstVulkanCommandPool
|
|||
GstVulkanQueue *queue;
|
||||
|
||||
VkCommandPool pool; /* hides a pointer */
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanCommandPoolClass:
|
||||
* @parent_class: the parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanCommandPoolClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -28,6 +28,13 @@
|
|||
#include "gstvkdebug.h"
|
||||
#include "gstvkdebug-private.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkdebug
|
||||
* @title: GstVulkanDebug
|
||||
* @short_description: Vulkan debugging utilities
|
||||
* @see_also: #GstVulkanDevice
|
||||
*/
|
||||
|
||||
#define FLAGS_TO_STRING(under_name, VkType) \
|
||||
gchar * G_PASTE(G_PASTE(gst_vulkan_,under_name),_flags_to_string) (VkType flag_bits) \
|
||||
{ \
|
||||
|
@ -65,6 +72,11 @@ static const struct
|
|||
{VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD, "device-uncached"},
|
||||
#endif
|
||||
};
|
||||
/**
|
||||
* gst_vulkan_memory_property_flags_to_string:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
FLAGS_TO_STRING(memory_property, VkMemoryPropertyFlags);
|
||||
|
||||
static const struct
|
||||
|
@ -77,6 +89,11 @@ static const struct
|
|||
{VK_MEMORY_HEAP_MULTI_INSTANCE_BIT, "multi-instance"},
|
||||
#endif
|
||||
};
|
||||
/**
|
||||
* gst_vulkan_memory_heap_flags_to_string:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
FLAGS_TO_STRING(memory_heap, VkMemoryHeapFlagBits);
|
||||
|
||||
static const struct
|
||||
|
@ -92,6 +109,11 @@ static const struct
|
|||
{VK_QUEUE_PROTECTED_BIT, "protected"},
|
||||
#endif
|
||||
};
|
||||
/**
|
||||
* gst_vulkan_queue_flags_to_string:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
FLAGS_TO_STRING(queue, VkQueueFlags);
|
||||
|
||||
static const struct
|
||||
|
@ -107,9 +129,22 @@ static const struct
|
|||
{VK_SAMPLE_COUNT_32_BIT, "32"},
|
||||
{VK_SAMPLE_COUNT_64_BIT, "64"},
|
||||
};
|
||||
/**
|
||||
* gst_vulkan_sample_count_flags_to_string:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
FLAGS_TO_STRING(sample_count, VkSampleCountFlags);
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/**
|
||||
* gst_vulkan_physical_device_type_to_string:
|
||||
* @type: a `VkPhysicalDeviceType
|
||||
*
|
||||
* Returns: name of @type
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
const gchar *
|
||||
gst_vulkan_physical_device_type_to_string (VkPhysicalDeviceType type)
|
||||
{
|
||||
|
|
|
@ -27,9 +27,32 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GST_VULKAN_EXTENT3D_FORMAT:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_EXTENT3D_FORMAT G_GUINT32_FORMAT ", %" G_GUINT32_FORMAT ", %" G_GUINT32_FORMAT
|
||||
|
||||
/**
|
||||
* GST_VULKAN_EXTENT3D_ARGS:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_EXTENT3D_ARGS(var) (var).width, (var).height, (var).depth
|
||||
|
||||
/**
|
||||
* GST_VULKAN_EXTENT2D_FORMAT:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_EXTENT2D_FORMAT G_GUINT32_FORMAT ", %" G_GUINT32_FORMAT
|
||||
|
||||
/**
|
||||
* GST_VULKAN_EXTENT2D_ARGS:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_EXTENT2D_ARGS(var) (var).width, (var).height
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* SECTION:vkdescriptorcache
|
||||
* @title: GstVulkanDescriptorCache
|
||||
* @short_description: Vulkan descriptor cache
|
||||
* @see_also: #GstVulkanDevice
|
||||
* @see_also: #GstVulkanDescriptorSet, #GstVulkanDescriptorPool, #GstVulkanDevice
|
||||
*/
|
||||
|
||||
#define GET_PRIV(cache) gst_vulkan_descriptor_cache_get_instance_private (cache)
|
||||
|
|
|
@ -33,16 +33,35 @@
|
|||
GST_VULKAN_API
|
||||
GType gst_vulkan_descriptor_cache_get_type (void);
|
||||
|
||||
/**
|
||||
* GstVulkanDescriptorCache:
|
||||
* @parent: the parent #GstObject
|
||||
* @pool: the #GstVulkanDescriptorPool to cache descriptor sets for
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDescriptorCache
|
||||
{
|
||||
GstVulkanHandlePool parent;
|
||||
|
||||
GstVulkanDescriptorPool *pool;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanDescriptorCacheClass:
|
||||
* @parent_class: the parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDescriptorCacheClass
|
||||
{
|
||||
GstVulkanHandlePoolClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* SECTION:vkdescriptorpool
|
||||
* @title: GstVulkanDescriptorPool
|
||||
* @short_description: Vulkan descriptor pool
|
||||
* @see_also: #GstVulkanDevice
|
||||
* @see_also: #GstVulkanDescriptorSet, #GstVulkanDescriptorCache, #GstVulkanDevice
|
||||
*/
|
||||
|
||||
#define GET_PRIV(pool) gst_vulkan_descriptor_pool_get_instance_private (pool)
|
||||
|
@ -89,7 +89,8 @@ gst_vulkan_descriptor_pool_finalize (GObject * object)
|
|||
/**
|
||||
* gst_vulkan_descriptor_pool_new_wrapped:
|
||||
* @device: a #GstVulkanDevice
|
||||
* @pool: (transfer full): a #VkDescriptorPool
|
||||
* @pool: (transfer full): a `VkDescriptorPool`
|
||||
* @max_sets: maximum descriptor sets allocatable wit @pool
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanDescriptorPool
|
||||
*
|
||||
|
@ -139,6 +140,8 @@ gst_vulkan_descriptor_pool_get_device (GstVulkanDescriptorPool * pool)
|
|||
* @pool: a #GstVulkanDescriptorPool
|
||||
*
|
||||
* Returns: the maximum number of sets allocatable from @pool
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gsize
|
||||
gst_vulkan_descriptor_pool_get_max_sets (GstVulkanDescriptorPool * pool)
|
||||
|
|
|
@ -32,6 +32,14 @@ GType gst_vulkan_descriptor_pool_get_type (void);
|
|||
#define GST_IS_VULKAN_DESCRIPTOR_POOL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_DESCRIPTOR_POOL))
|
||||
#define GST_VULKAN_DESCRIPTOR_POOL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_DESCRIPTOR_POOL, GstVulkanDescriptorPoolClass))
|
||||
|
||||
/**
|
||||
* GstVulkanDescriptorPool:
|
||||
* @parent: the parent #GstObject
|
||||
* @device: the #GstVulkanDevice for descriptor sets
|
||||
* @pool: the vulksn descriptor pool handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDescriptorPool
|
||||
{
|
||||
GstObject parent;
|
||||
|
@ -39,11 +47,23 @@ struct _GstVulkanDescriptorPool
|
|||
GstVulkanDevice *device;
|
||||
|
||||
VkDescriptorPool pool; /* hides a pointer */
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanDescriptorPoolClass:
|
||||
* @parent_class: the parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDescriptorPoolClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* SECTION:vulkandescriptorset
|
||||
* @title: vulkandescriptorset
|
||||
* SECTION:vkdescriptorset
|
||||
* @title: GstVulkanDescriptorSet
|
||||
* @short_description: Vulkan descriptor set
|
||||
* @see_also: #GstVulkanDescriptorPool, #GstVulkanDescriptorCache, #GstVulkanDevice
|
||||
*
|
||||
* vulkandescriptorset holds information about a descriptor set.
|
||||
*/
|
||||
|
@ -117,6 +119,8 @@ gst_vulkan_descriptor_set_init (GstVulkanDescriptorSet * set,
|
|||
* @set: a VkDescriptorSet
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanDescriptorSet
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanDescriptorSet *
|
||||
gst_vulkan_descriptor_set_new_wrapped (GstVulkanDescriptorPool * pool,
|
||||
|
|
|
@ -28,12 +28,33 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* gst_vulkan_descriptor_set_get_type:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_descriptor_set_get_type (void);
|
||||
/**
|
||||
* GST_TYPE_VULKAN_DESCRIPTOR_SET:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_TYPE_VULKAN_DESCRIPTOR_SET (gst_vulkan_descriptor_set_get_type ())
|
||||
|
||||
typedef struct _GstVulkanDescriptorSet GstVulkanDescriptorSet;
|
||||
|
||||
/**
|
||||
* GstVulkanDescriptorSet:
|
||||
* @parent: the parent #GstMiniObject
|
||||
* @set: the vulkan descriptor set handle
|
||||
* @pool: the parent #GstVulkanDescriptorPool for pooling
|
||||
* @cache: the parent #GstVulkanDescriptorCache for reuse
|
||||
* @n_layouts: number of layouts applied to this descriptor set
|
||||
* @layouts: layouts applied to this descriptor set
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDescriptorSet
|
||||
{
|
||||
GstMiniObject parent;
|
||||
|
@ -47,7 +68,8 @@ struct _GstVulkanDescriptorSet
|
|||
guint n_layouts;
|
||||
GstVulkanHandle **layouts;
|
||||
|
||||
GMutex lock;
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -56,7 +78,9 @@ struct _GstVulkanDescriptorSet
|
|||
*
|
||||
* Increases the refcount of the given buffer by one.
|
||||
*
|
||||
* Returns: (transfer full): @buf
|
||||
* Returns: (transfer full): @set
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline GstVulkanDescriptorSet* gst_vulkan_descriptor_set_ref(GstVulkanDescriptorSet* set);
|
||||
static inline GstVulkanDescriptorSet *
|
||||
|
@ -71,6 +95,8 @@ gst_vulkan_descriptor_set_ref (GstVulkanDescriptorSet * set)
|
|||
*
|
||||
* Decreases the refcount of the buffer. If the refcount reaches 0, the buffer
|
||||
* will be freed.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline void gst_vulkan_descriptor_set_unref(GstVulkanDescriptorSet* set);
|
||||
static inline void
|
||||
|
@ -85,13 +111,13 @@ gst_vulkan_descriptor_set_unref (GstVulkanDescriptorSet * set)
|
|||
*
|
||||
* Clears a reference to a #GstVulkanDescriptorSet.
|
||||
*
|
||||
* @buf_ptr must not be %NULL.
|
||||
* @set_ptr must not be %NULL.
|
||||
*
|
||||
* If the reference is %NULL then this function does nothing. Otherwise, the
|
||||
* reference count of the descriptor set is decreased and the pointer is set
|
||||
* to %NULL.
|
||||
*
|
||||
* Since: 1.16
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline void
|
||||
gst_clear_vulkan_descriptor_set (GstVulkanDescriptorSet ** set_ptr)
|
||||
|
@ -99,9 +125,6 @@ gst_clear_vulkan_descriptor_set (GstVulkanDescriptorSet ** set_ptr)
|
|||
gst_clear_mini_object ((GstMiniObject **) set_ptr);
|
||||
}
|
||||
|
||||
#define gst_vulkan_descriptor_set_lock(set) g_mutex_lock (&((set)->lock))
|
||||
#define gst_vulkan_descriptor_set_unlock(set) g_mutex_unlock (&((set)->lock))
|
||||
|
||||
GST_VULKAN_API
|
||||
GstVulkanDescriptorSet * gst_vulkan_descriptor_set_new_wrapped (GstVulkanDescriptorPool * pool,
|
||||
VkDescriptorSet set,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
* SECTION:vkdevice
|
||||
* @title: GstVulkanDevice
|
||||
* @short_description: Vulkan device
|
||||
* @see_also: #GstVulkanInstance, #GstVulkanPhysicalDevice
|
||||
* @see_also: #GstVulkanPhysicalDevice, #GstVulkanInstance
|
||||
*
|
||||
* A #GstVulkanDevice encapsulates a VkDevice
|
||||
*/
|
||||
|
@ -255,7 +255,7 @@ gst_vulkan_device_finalize (GObject * object)
|
|||
* @device: a #GstVulkanDevice
|
||||
* @error: a #GError
|
||||
*
|
||||
* Attempts to create the internal #VkDevice object.
|
||||
* Attempts to create the internal `VkDevice` object.
|
||||
*
|
||||
* Returns: whether a vulkan device could be created
|
||||
*
|
||||
|
@ -422,7 +422,7 @@ gst_vulkan_device_foreach_queue (GstVulkanDevice * device,
|
|||
* @device: a #GstVulkanDevice
|
||||
* @name: name of the function to retrieve
|
||||
*
|
||||
* Performs vkGetDeviceProcAddr() with @device and @name
|
||||
* Performs `vkGetDeviceProcAddr()` with @device and @name
|
||||
*
|
||||
* Returns: the function pointer for @name or %NULL
|
||||
*
|
||||
|
@ -624,6 +624,15 @@ gst_vulkan_device_run_context_query (GstElement * element,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_device_create_fence:
|
||||
* @device: a #GstVulkanDevice
|
||||
* @error: a #GError to fill on failure
|
||||
*
|
||||
* Returns: a new #GstVulkanFence or %NULL
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanFence *
|
||||
gst_vulkan_device_create_fence (GstVulkanDevice * device, GError ** error)
|
||||
{
|
||||
|
@ -669,6 +678,8 @@ gst_vulkan_device_is_extension_enabled_unlocked (GstVulkanDevice * device,
|
|||
* @name: extension name
|
||||
*
|
||||
* Returns: whether extension @name is enabled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_device_is_extension_enabled (GstVulkanDevice * device,
|
||||
|
@ -714,6 +725,8 @@ gst_vulkan_device_enable_extension_unlocked (GstVulkanDevice * device,
|
|||
* only have an effect before the call to gst_vulkan_device_open().
|
||||
*
|
||||
* Returns: whether the Vulkan extension could be enabled.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_device_enable_extension (GstVulkanDevice * device,
|
||||
|
@ -760,6 +773,8 @@ gst_vulkan_device_disable_extension_unlocked (GstVulkanDevice * device,
|
|||
* an effect before the call to gst_vulkan_device_open().
|
||||
*
|
||||
* Returns: whether the Vulkan extension could be disabled.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_device_disable_extension (GstVulkanDevice * device,
|
||||
|
@ -792,6 +807,8 @@ gst_vulkan_device_is_layer_enabled_unlocked (GstVulkanDevice * device,
|
|||
* @name: layer name
|
||||
*
|
||||
* Returns: whether layer @name is enabled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_device_is_layer_enabled (GstVulkanDevice * device,
|
||||
|
@ -837,6 +854,8 @@ gst_vulkan_device_enable_layer_unlocked (GstVulkanDevice * device,
|
|||
* only have an effect before the call to gst_vulkan_device_open().
|
||||
*
|
||||
* Returns: whether the Vulkan layer could be enabled.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_device_enable_layer (GstVulkanDevice * device, const gchar * name)
|
||||
|
|
|
@ -35,10 +35,29 @@ G_BEGIN_DECLS
|
|||
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;
|
||||
|
@ -46,11 +65,23 @@ struct _GstVulkanDevice
|
|||
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];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -429,7 +429,7 @@ gst_vulkan_display_find_window (GstVulkanDisplay * display, gpointer data,
|
|||
|
||||
/**
|
||||
* gst_vulkan_display_remove_window:
|
||||
* @display: a #GstVUlkanDisplay:
|
||||
* @display: a #GstVulkanDisplay
|
||||
* @window: the #GstVulkanWindow to remove
|
||||
*
|
||||
* Returns: whether the window was successfully removed
|
||||
|
@ -612,7 +612,7 @@ gst_vulkan_display_choose_type_unlocked (GstVulkanInstance * instance)
|
|||
* gst_vulkan_display_choose_type:
|
||||
* @instance: a #GstVulkanInstance
|
||||
*
|
||||
* This function will read the %GST_VULKAN_WINDOW environment variable for
|
||||
* This function will read the `GST_VULKAN_WINDOW` environment variable for
|
||||
* a user choice or choose the first supported implementation.
|
||||
*
|
||||
* gst_vulkan_instance_fill_info() must have been called prior to this function.
|
||||
|
|
|
@ -33,11 +33,21 @@ G_BEGIN_DECLS
|
|||
#define GST_VULKAN_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_VULKAN_DISPLAY,GstVulkanDisplayClass))
|
||||
#define GST_IS_VULKAN_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VULKAN_DISPLAY))
|
||||
#define GST_IS_VULKAN_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VULKAN_DISPLAY))
|
||||
#define GST_VULKAN_DISPLAY_CAST(obj) ((GstVulkanDisplay*)(obj))
|
||||
#define GST_VULKAN_DISPLAY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_DISPLAY, GstVulkanDisplayClass))
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_display_get_type (void);
|
||||
/**
|
||||
* GST_VULKAN_DISPLAY_CAST
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_DISPLAY_CAST(obj) ((GstVulkanDisplay*)(obj))
|
||||
|
||||
/**
|
||||
* GST_VULKAN_DISPLAY_CONTEXT_TYPE_STR
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_DISPLAY_CONTEXT_TYPE_STR "gst.vulkan.display"
|
||||
|
||||
typedef struct _GstVulkanDisplay GstVulkanDisplay;
|
||||
|
@ -52,6 +62,9 @@ typedef struct _GstVulkanDisplayPrivate GstVulkanDisplayPrivate;
|
|||
* @GST_VULKAN_DISPLAY_TYPE_COCOA: cocoa display for macOS
|
||||
* @GST_VULKAN_DISPLAY_TYPE_IOS: ios display
|
||||
* @GST_VULKAN_DISPLAY_TYPE_WIN32: win32 display
|
||||
* @GST_VULKAN_DISPLAY_TYPE_ANY: any display type
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
|
@ -71,6 +84,8 @@ typedef enum
|
|||
*
|
||||
* The contents of a #GstVulkanDisplay are private and should only be accessed
|
||||
* through the provided API
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDisplay
|
||||
{
|
||||
|
@ -86,14 +101,28 @@ struct _GstVulkanDisplay
|
|||
GMainContext *main_context;
|
||||
GMainLoop *main_loop;
|
||||
GSource *event_source;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanDisplayClass:
|
||||
* @object_class: parent #GstObjectClass
|
||||
* @get_handle: get the native handle to the display
|
||||
* @create_window: create a window
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDisplayClass
|
||||
{
|
||||
GstObjectClass object_class;
|
||||
|
||||
gpointer (*get_handle) (GstVulkanDisplay * display);
|
||||
GstVulkanWindow * (*create_window) (GstVulkanDisplay * display);
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -26,6 +26,13 @@
|
|||
|
||||
#include "gstvkerror.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkerror
|
||||
* @title: GstVulkanError
|
||||
* @short_description: Vulkan errors
|
||||
* @see_also: #GstVulkanInstance, #GstVulkanDevice
|
||||
*/
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
static const struct
|
||||
{
|
||||
|
@ -79,7 +86,7 @@ _vk_result_to_string (VkResult result)
|
|||
* @format: the printf-like format to write into the #GError
|
||||
* @...: arguments for @format
|
||||
*
|
||||
* if @result indicates an error condition, fills out #Gerror with details of
|
||||
* if @result indicates an error condition, fills out #GError with details of
|
||||
* the error
|
||||
*
|
||||
* Returns: @result for easy chaining
|
||||
|
|
|
@ -27,10 +27,27 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GST_VULKAN_ERROR:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_ERROR (gst_vulkan_error_quark ())
|
||||
|
||||
/**
|
||||
* gst_vulkan_error_quark:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GST_VULKAN_API
|
||||
GQuark gst_vulkan_error_quark (void);
|
||||
|
||||
/**
|
||||
* GstVulkanError:
|
||||
* @GST_VULKAN_FAILED: undetermined error
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
/* custom error values */
|
||||
typedef enum
|
||||
{
|
||||
|
|
|
@ -130,6 +130,8 @@ gst_vulkan_fence_new (GstVulkanDevice * device, GError ** error)
|
|||
* gst_vulkan_fence_new_always_signalled:
|
||||
*
|
||||
* Returns: a new #GstVulkanFence that is always in the signalled state
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanFence *
|
||||
gst_vulkan_fence_new_always_signalled (GstVulkanDevice * device)
|
||||
|
|
|
@ -25,13 +25,37 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GST_TYPE_VULKAN_FENCE:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_TYPE_VULKAN_FENCE (gst_vulkan_fence_get_type ())
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_fence_get_type (void);
|
||||
|
||||
/**
|
||||
* GST_VULKAN_FENCE_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_FENCE_CAST(f) ((GstVulkanFence *) f)
|
||||
/**
|
||||
* GST_VULKAN_FENCE_FENCE:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_FENCE_FENCE(f) (GST_VULKAN_FENCE_CAST(f)->fence)
|
||||
|
||||
/**
|
||||
* GstVulkanFence:
|
||||
* @parent: the parent #GstMiniObject
|
||||
* @device: the #GstVulkanDevice this fence is allocated from
|
||||
* @cache: the parent #GstVulkanFenceCache for fence reuse
|
||||
* @fence: the vulkan fence handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanFence
|
||||
{
|
||||
GstMiniObject parent;
|
||||
|
@ -40,6 +64,9 @@ struct _GstVulkanFence
|
|||
GstVulkanFenceCache *cache;
|
||||
|
||||
VkFence fence;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
@ -75,6 +102,12 @@ GType gst_vulkan_fence_cache_get_type (void);
|
|||
#define GST_IS_VULKAN_FENCE_CACHE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_FENCE_CACHE))
|
||||
#define GST_VULKAN_FENCE_CACHE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_FENCE_CACHE, GstVulkanFenceCacheClass))
|
||||
|
||||
/**
|
||||
* GstVulkanFenceCache:
|
||||
* @parent: the parent #GstVulkanHandlePool
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanFenceCache
|
||||
{
|
||||
GstVulkanHandlePool parent;
|
||||
|
@ -83,13 +116,31 @@ struct _GstVulkanFenceCache
|
|||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanFenceCacheClass:
|
||||
* @parent_class: the parent #GstVulkanHandlePoolClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanFenceCacheClass
|
||||
{
|
||||
GstVulkanHandlePoolClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GstVulkanFenceCache * gst_vulkan_fence_cache_new (GstVulkanDevice * device);
|
||||
|
||||
/**
|
||||
* gst_vulkan_fence_cache_acquire:
|
||||
* @o: the #GstVulkanFenceCache
|
||||
* @e: a #GError
|
||||
*
|
||||
* A helper define for internally calling @gst_vulkan_handle_pool_acquire()
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define gst_vulkan_fence_cache_acquire(o,e) (GstVulkanFence *) gst_vulkan_handle_pool_acquire (GST_VULKAN_HANDLE_POOL (o),e);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -24,6 +24,13 @@
|
|||
|
||||
#include "gstvkformat.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkformat
|
||||
* @title: GstVulkanFormat
|
||||
* @short_description: Vulkan formats
|
||||
* @see_also: #GstVulkanDevice, #GstVulkanMemory, #GstVulkanImageMemory
|
||||
*/
|
||||
|
||||
#define FORMAT(name, scaling) \
|
||||
G_PASTE(G_PASTE(VK_FORMAT_,name),G_PASTE(_,scaling)), G_STRINGIFY(G_PASTE(G_PASTE(name,_),scaling)), G_PASTE(GST_VULKAN_FORMAT_SCALING_, scaling)
|
||||
#define FLAG(v) \
|
||||
|
@ -408,6 +415,14 @@ FIXME: implement:
|
|||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* gst_vulkan_format_get_info:
|
||||
* @format: a valid `VkFormat`
|
||||
*
|
||||
* Returns: the #GstVulkanFormatInfo for @format or %NULL
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
const GstVulkanFormatInfo *
|
||||
gst_vulkan_format_get_info (VkFormat format)
|
||||
{
|
||||
|
|
|
@ -27,8 +27,25 @@ G_BEGIN_DECLS
|
|||
|
||||
typedef struct _GstVulkanFormatInfo GstVulkanFormatInfo;
|
||||
|
||||
/**
|
||||
* GST_VULKAN_MAX_COMPONENTS:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_MAX_COMPONENTS 4
|
||||
|
||||
/**
|
||||
* GstVulkanFormatScaling:
|
||||
* @GST_VULKAN_FORMAT_SCALING_UNORM: [0, 2^n - 1] -> [0.0, 1.0]
|
||||
* @GST_VULKAN_FORMAT_SCALING_SNORM: [-2^(n-1), 2^(n-1) - 1] -> [-1.0, 1.0]
|
||||
* @GST_VULKAN_FORMAT_SCALING_USCALED: [0, 2^n - 1] -> [0.0, float(2^n - 1)]
|
||||
* @GST_VULKAN_FORMAT_SCALING_SSCALED: [-2^(n-1), 2^(n-1) - 1] -> [float(-2^(n-1)), float(2^(n-1) - 1)]
|
||||
* @GST_VULKAN_FORMAT_SCALING_UINT: [0, 2^n - 1] -> [0, 2^n - 1]
|
||||
* @GST_VULKAN_FORMAT_SCALING_SINT: [-2^(n-1), 2^(n-1) - 1] -> [-2^(n-1), 2^(n-1) - 1]
|
||||
* @GST_VULKAN_FORMAT_SCALING_SRGB: @GST_VULKAN_FORMAT_SCALING_UNORM but the first three components are gamma corrected for the sRGB colour space.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GST_VULKAN_FORMAT_SCALING_UNORM = 1,
|
||||
|
@ -40,6 +57,16 @@ typedef enum
|
|||
GST_VULKAN_FORMAT_SCALING_SRGB,
|
||||
} GstVulkanFormatScaling;
|
||||
|
||||
/**
|
||||
* GstVulkanFormatFlags:
|
||||
* @GST_VULKAN_FORMAT_FLAG_YUV: is a YUV format
|
||||
* @GST_VULKAN_FORMAT_FLAG_RGB: is a RGB format
|
||||
* @GST_VULKAN_FORMAT_FLAG_ALPHA: has an alpha channel
|
||||
* @GST_VULKAN_FORMAT_FLAG_LE: data is stored in little-endiate byte order
|
||||
* @GST_VULKAN_FORMAT_FLAG_COMPLEX: data is stored complex and cannot be read/write only using the information in the #GstVulkanFormatInfo
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GST_VULKAN_FORMAT_FLAG_YUV = (1 << 0),
|
||||
|
@ -54,12 +81,26 @@ typedef enum
|
|||
* @format: the Vulkan format being described
|
||||
* @name: name of this format
|
||||
* @scaling: how raw data is interpreted and scaled
|
||||
* @flags: flags that apply to this format
|
||||
* @bits: The number of bits used to pack data items. This can be less than
|
||||
* 8 when multiple pixels are stored in a byte. for values > 8 multiple
|
||||
* bytes should be read according to the endianness flag before
|
||||
* applying the shift and mask.
|
||||
* @n_components; number of components in this format
|
||||
* @comp_order: the order of the components. The 'R' component can be
|
||||
* found at index 0, the G component at index 1, etc
|
||||
* @comp_offset: number of bits from the start of a pixel where the component
|
||||
* is located
|
||||
* @comp_depth: number of bits the component uses
|
||||
* @shift: the number of bits to shift away to get the component data
|
||||
* @depth: the depth in bits for each component
|
||||
* @n_planes: the number of planes for this format. The number of planes can
|
||||
* be less than the amount of components when multiple components
|
||||
* are packed into one plane.
|
||||
* @plane: the plane number where a component can be found
|
||||
* @poffset: the offset in the plane where the first pixel of the components
|
||||
* can be found.
|
||||
* @w_sub: subsampling factor of the width for the component.
|
||||
* Use GST_VIDEO_SUB_SCALE to scale a width.
|
||||
* @h_sub: subsampling factor of the height for the component.
|
||||
* Use GST_VIDEO_SUB_SCALE to scale a height.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanFormatInfo
|
||||
{
|
||||
|
|
|
@ -24,6 +24,16 @@
|
|||
|
||||
#include "gstvkfullscreenquad.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkfullscreenquad
|
||||
* @title: GstVulkanFullScreenQuad
|
||||
* @short_description: Vulkan full screen quad
|
||||
* @see_also: #GstVulkanDevice, #GstVulkanImageMemory
|
||||
*
|
||||
* A #GstVulkanFullScreenQuad is a helper object for rendering a single input
|
||||
* image to an output #GstBuffer
|
||||
*/
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_full_screen_quad_debug
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
||||
|
||||
|
@ -620,84 +630,33 @@ gst_vulkan_full_screen_quad_get_last_fence (GstVulkanFullScreenQuad * self)
|
|||
return LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_descriptor_set (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
|
||||
if (self->descriptor_set)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_mini_object_unref,
|
||||
(GstMiniObject *) self->descriptor_set));
|
||||
self->descriptor_set = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
#define clear_field(field,type,trash_free_func) \
|
||||
static void \
|
||||
G_PASTE(clear_,field) (GstVulkanFullScreenQuad * self) \
|
||||
{ \
|
||||
GstVulkanFence *last_fence = \
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device); \
|
||||
\
|
||||
if (self->field) \
|
||||
gst_vulkan_trash_list_add (self->trash_list, \
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence, \
|
||||
trash_free_func, (type) self->field)); \
|
||||
self->field = NULL; \
|
||||
\
|
||||
gst_vulkan_fence_unref (last_fence); \
|
||||
}
|
||||
|
||||
static void
|
||||
clear_framebuffer (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
#define clear_field_mini_object(field) clear_field (field,GstMiniObject *,gst_vulkan_trash_mini_object_unref);
|
||||
#define clear_field_object(field) clear_field (field,GstObject *,gst_vulkan_trash_object_unref);
|
||||
|
||||
if (self->framebuffer)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_mini_object_unref,
|
||||
(GstMiniObject *) self->framebuffer));
|
||||
self->framebuffer = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_command_pool (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
|
||||
if (self->cmd_pool)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_object_unref, (GstObject *) self->cmd_pool));
|
||||
self->cmd_pool = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_sampler (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
|
||||
if (self->sampler)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_mini_object_unref,
|
||||
(GstMiniObject *) self->sampler));
|
||||
self->sampler = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_descriptor_cache (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
|
||||
if (self->descriptor_cache)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_object_unref,
|
||||
(GstObject *) self->descriptor_cache));
|
||||
self->descriptor_cache = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
clear_field_mini_object (descriptor_set);
|
||||
clear_field_mini_object (framebuffer);
|
||||
clear_field_mini_object (sampler);
|
||||
clear_field_mini_object (pipeline_layout);
|
||||
clear_field_mini_object (graphics_pipeline);
|
||||
clear_field_mini_object (descriptor_set_layout);
|
||||
clear_field_object (cmd_pool);
|
||||
clear_field_object (descriptor_cache);
|
||||
|
||||
static void
|
||||
clear_shaders (GstVulkanFullScreenQuad * self)
|
||||
|
@ -790,54 +749,6 @@ clear_render_pass (GstVulkanFullScreenQuad * self)
|
|||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_pipeline_layout (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
|
||||
if (self->pipeline_layout)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_mini_object_unref,
|
||||
(GstMiniObject *) self->pipeline_layout));
|
||||
self->pipeline_layout = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_graphics_pipeline (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
|
||||
if (self->graphics_pipeline)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_mini_object_unref,
|
||||
(GstMiniObject *) self->graphics_pipeline));
|
||||
self->graphics_pipeline = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
|
||||
static void
|
||||
clear_descriptor_set_layout (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
GstVulkanFence *last_fence =
|
||||
LAST_FENCE_OR_ALWAYS_SIGNALLED (self, self->queue->device);
|
||||
|
||||
if (self->descriptor_set_layout)
|
||||
gst_vulkan_trash_list_add (self->trash_list,
|
||||
gst_vulkan_trash_list_acquire (self->trash_list, last_fence,
|
||||
gst_vulkan_trash_mini_object_unref,
|
||||
(GstMiniObject *) self->descriptor_set_layout));
|
||||
self->descriptor_set_layout = NULL;
|
||||
|
||||
gst_vulkan_fence_unref (last_fence);
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_pipeline (GstVulkanFullScreenQuad * self)
|
||||
{
|
||||
|
@ -860,6 +771,14 @@ gst_vulkan_full_screen_quad_init (GstVulkanFullScreenQuad * self)
|
|||
self->trash_list = gst_vulkan_trash_fence_list_new ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_new:
|
||||
* @queue: a #GstVulkanQueue
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanFullScreenQuad
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanFullScreenQuad *
|
||||
gst_vulkan_full_screen_quad_new (GstVulkanQueue * queue)
|
||||
{
|
||||
|
@ -870,6 +789,8 @@ gst_vulkan_full_screen_quad_new (GstVulkanQueue * queue)
|
|||
self = g_object_new (GST_TYPE_VULKAN_FULL_SCREEN_QUAD, NULL);
|
||||
self->queue = gst_object_ref (queue);
|
||||
|
||||
gst_object_ref_sink (self);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -880,7 +801,7 @@ gst_vulkan_full_screen_quad_finalize (GObject * object)
|
|||
GstVulkanFullScreenQuadPrivate *priv = GET_PRIV (self);
|
||||
|
||||
destroy_pipeline (self);
|
||||
clear_command_pool (self);
|
||||
clear_cmd_pool (self);
|
||||
clear_sampler (self);
|
||||
clear_framebuffer (self);
|
||||
clear_descriptor_set (self);
|
||||
|
@ -912,6 +833,16 @@ gst_vulkan_full_screen_quad_class_init (GstVulkanFullScreenQuadClass * klass)
|
|||
obj_class->finalize = gst_vulkan_full_screen_quad_finalize;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_set_info:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @in_info: the input #GstVideoInfo to set
|
||||
* @out_info: the output #GstVideoInfo to set
|
||||
*
|
||||
* Returns: whether the information could be successfully set
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_set_info (GstVulkanFullScreenQuad * self,
|
||||
GstVideoInfo * in_info, GstVideoInfo * out_info)
|
||||
|
@ -928,6 +859,16 @@ gst_vulkan_full_screen_quad_set_info (GstVulkanFullScreenQuad * self,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_set_input_buffer:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @buffer: the input #GstBuffer to set
|
||||
* @error: #GError to fill on failure
|
||||
*
|
||||
* Returns: whether the input buffer could be changed
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_set_input_buffer (GstVulkanFullScreenQuad * self,
|
||||
GstBuffer * buffer, GError ** error)
|
||||
|
@ -943,6 +884,16 @@ gst_vulkan_full_screen_quad_set_input_buffer (GstVulkanFullScreenQuad * self,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_set_output_buffer:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @buffer: the output #GstBuffer to set
|
||||
* @error: #GError to fill on failure
|
||||
*
|
||||
* Returns: whether the input buffer could be changed
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_set_output_buffer (GstVulkanFullScreenQuad * self,
|
||||
GstBuffer * buffer, GError ** error)
|
||||
|
@ -958,6 +909,16 @@ gst_vulkan_full_screen_quad_set_output_buffer (GstVulkanFullScreenQuad * self,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_set_shaders:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @vert: the vertex shader to set
|
||||
* @frag: the fragment shader to set
|
||||
*
|
||||
* Returns: whether the shaders could be set
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_set_shaders (GstVulkanFullScreenQuad * self,
|
||||
GstVulkanHandle * vert, GstVulkanHandle * frag)
|
||||
|
@ -981,6 +942,16 @@ gst_vulkan_full_screen_quad_set_shaders (GstVulkanFullScreenQuad * self,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_set_uniform_buffer:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @uniforms: the uniform data to set. Must be a #GstVulkanBufferMemory
|
||||
* @error: a #GError to fill on failure
|
||||
*
|
||||
* Returns: whether the shaders could be set
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_set_uniform_buffer (GstVulkanFullScreenQuad * self,
|
||||
GstMemory * uniforms, GError ** error)
|
||||
|
@ -1002,6 +973,19 @@ gst_vulkan_full_screen_quad_set_uniform_buffer (GstVulkanFullScreenQuad * self,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_set_index_buffer:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @indices: the index data. Must be a #GstVulkanBufferMemory
|
||||
* @n_indices: number of indices in @indices
|
||||
* @error: #GError to fill on failure
|
||||
*
|
||||
* See also gst_vulkan_full_screen_quad_set_vertex_buffer()
|
||||
*
|
||||
* Returns: whether the index data could be set
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_set_index_buffer (GstVulkanFullScreenQuad * self,
|
||||
GstMemory * indices, gsize n_indices, GError ** error)
|
||||
|
@ -1023,6 +1007,16 @@ gst_vulkan_full_screen_quad_set_index_buffer (GstVulkanFullScreenQuad * self,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_set_vertex_buffer:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @vertices: the vertex data. Must be a #GstVulkanBufferMemory
|
||||
* @error: #GError to fill on failure
|
||||
*
|
||||
* Returns: whether the index data could be set
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_set_vertex_buffer (GstVulkanFullScreenQuad * self,
|
||||
GstMemory * vertices, GError ** error)
|
||||
|
@ -1104,6 +1098,22 @@ failure:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_draw:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @error: a #GError filled on error
|
||||
*
|
||||
* Helper function for creation and submission of a command buffer that draws
|
||||
* a full screen quad. If you need to add other things to the command buffer,
|
||||
* create the command buffer manually and call
|
||||
* gst_vulkan_full_screen_quad_prepare_draw(),
|
||||
* gst_vulkan_full_screen_quad_fill_command_buffer() and
|
||||
* gst_vulkan_full_screen_quad_submit() instead.
|
||||
*
|
||||
* Returns: whether the draw was successful
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_draw (GstVulkanFullScreenQuad * self,
|
||||
GError ** error)
|
||||
|
@ -1167,6 +1177,17 @@ error:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_full_screen_quad_prepare_draw:
|
||||
* @self: the #GstVulkanFullScreenQuad
|
||||
* @fence: a #GstVulkanFence that will be signalled after submission
|
||||
* @error: a #GError filled on error
|
||||
*
|
||||
* Returns: whether the necessary information could be generated for drawing a
|
||||
* frame.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_prepare_draw (GstVulkanFullScreenQuad * self,
|
||||
GstVulkanFence * fence, GError ** error)
|
||||
|
@ -1251,6 +1272,8 @@ error:
|
|||
* @error: a #GError to fill on error
|
||||
*
|
||||
* Returns: whether @cmd could be filled with the necessary commands
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_fill_command_buffer (GstVulkanFullScreenQuad * self,
|
||||
|
@ -1405,6 +1428,8 @@ error:
|
|||
* @error: a #GError to fill on error
|
||||
*
|
||||
* Returns: whether @cmd could be submitted to the queue
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_full_screen_quad_submit (GstVulkanFullScreenQuad * self,
|
||||
|
|
|
@ -37,10 +37,31 @@ GType gst_vulkan_full_screen_quad_get_type (void);
|
|||
#define GST_IS_VULKAN_FULL_SCREEN_QUAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VULKAN_FULL_SCREEN_QUAD))
|
||||
#define GST_VULKAN_FULL_SCREEN_QUAD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VULKAN_FULL_SCREEN_QUAD, GstVulkanFullScreenQuadClass))
|
||||
|
||||
/**
|
||||
* GstVulkanFullScreenQuad:
|
||||
* @parent: the parent #GstObject
|
||||
* @in_info: the configured input #GstVideoInfo
|
||||
* @out_info: the configured output #GstVideoInfo
|
||||
* @queue: the #GstVulkanQueue to submit #GstVulkanCommandBuffer's on
|
||||
* @render_pass: the configured `VkRenderPass`
|
||||
* @pipeline_layout: the configured `VkPipelineLayout`
|
||||
* @graphics_pipeline: the configured `VkPipeline`
|
||||
* @descriptor_set_layout: the configured `VkDescriptorSetLayout`
|
||||
* @descriptor_cache: the configured #GstVulkanDescriptorCache
|
||||
* @descriptor_set: the configured #GstVulkanDescriptorSet
|
||||
* @framebuffer: the configured `VkFramebuffer`
|
||||
* @sampler: the configured `VkSampler`
|
||||
* @cmd_pool: the #GstVulkanCommandPool to allocate #GstVulkanCommandBuffer's from
|
||||
* @trash_list: the #GstVulkanTrashList for freeing unused resources
|
||||
* @last_fence: the last configured #GstVulkanFences
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanFullScreenQuad
|
||||
{
|
||||
GstObject parent;
|
||||
|
||||
/* <protected> */
|
||||
GstVideoInfo out_info;
|
||||
GstVideoInfo in_info;
|
||||
|
||||
|
@ -59,11 +80,23 @@ struct _GstVulkanFullScreenQuad
|
|||
|
||||
GstVulkanTrashList *trash_list;
|
||||
GstVulkanFence *last_fence;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanFullScreenQuadClass:
|
||||
* @parent_class: the parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanFullScreenQuadClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -19,8 +19,10 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* SECTION:vulkanhandle
|
||||
* @title: vulkanhandle
|
||||
* SECTION:vkhandle
|
||||
* @title: GstVulkanHandle
|
||||
* @short_description: Vulkan handles
|
||||
* @see_also: #GstVulkanHandlePool, #GstVulkanDevice
|
||||
*
|
||||
* #GstVulkanHandle holds information about a vulkan handle.
|
||||
*/
|
||||
|
@ -86,6 +88,8 @@ gst_vulkan_handle_init (GstVulkanHandle * handle, GstVulkanDevice * device,
|
|||
* @user_data: data to pass to @notify
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanHandle wrapping @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanHandle *
|
||||
gst_vulkan_handle_new_wrapped (GstVulkanDevice * device,
|
||||
|
@ -108,6 +112,8 @@ GST_DEFINE_MINI_OBJECT_TYPE (GstVulkanHandle, gst_vulkan_handle);
|
|||
* @user_data: callback user data
|
||||
*
|
||||
* Frees the descriptor set layout in @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_handle_free_descriptor_set_layout (GstVulkanHandle * handle,
|
||||
|
@ -128,6 +134,8 @@ gst_vulkan_handle_free_descriptor_set_layout (GstVulkanHandle * handle,
|
|||
* @user_data: callback user data
|
||||
*
|
||||
* Frees the pipeline in @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_handle_free_pipeline (GstVulkanHandle * handle, gpointer user_data)
|
||||
|
@ -145,6 +153,8 @@ gst_vulkan_handle_free_pipeline (GstVulkanHandle * handle, gpointer user_data)
|
|||
* @user_data: callback user data
|
||||
*
|
||||
* Frees the pipeline layout in @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_handle_free_pipeline_layout (GstVulkanHandle * handle,
|
||||
|
@ -164,6 +174,8 @@ gst_vulkan_handle_free_pipeline_layout (GstVulkanHandle * handle,
|
|||
* @user_data: callback user data
|
||||
*
|
||||
* Frees the render pass in @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_handle_free_render_pass (GstVulkanHandle * handle,
|
||||
|
@ -183,6 +195,8 @@ gst_vulkan_handle_free_render_pass (GstVulkanHandle * handle,
|
|||
* @user_data: callback user data
|
||||
*
|
||||
* Frees the sampler in @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_handle_free_sampler (GstVulkanHandle * handle, gpointer user_data)
|
||||
|
@ -200,6 +214,8 @@ gst_vulkan_handle_free_sampler (GstVulkanHandle * handle, gpointer user_data)
|
|||
* @user_data: callback user data
|
||||
*
|
||||
* Frees the framebuffer in @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_handle_free_framebuffer (GstVulkanHandle * handle,
|
||||
|
@ -219,6 +235,8 @@ gst_vulkan_handle_free_framebuffer (GstVulkanHandle * handle,
|
|||
* @user_data: callback user data
|
||||
*
|
||||
* Frees the shader in @handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_handle_free_shader (GstVulkanHandle * handle, gpointer user_data)
|
||||
|
|
|
@ -28,16 +28,33 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* gst_vulkan_handle_get_type:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_handle_get_type (void);
|
||||
/**
|
||||
* GST_TYPE_VULKAN_HANDLE:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_TYPE_VULKAN_HANDLE (gst_vulkan_handle_get_type ())
|
||||
|
||||
/**
|
||||
* GstVulkanHandleTypedef:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
VK_DEFINE_NON_DISPATCHABLE_HANDLE(GstVulkanHandleTypedef)
|
||||
|
||||
/**
|
||||
* GST_VULKAN_NON_DISPATCHABLE_HANDLE_FORMAT:
|
||||
*
|
||||
* The printf format specifier for raw Vulkan non dispatchable handles.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#if GLIB_SIZEOF_VOID_P == 8
|
||||
# define GST_VULKAN_NON_DISPATCHABLE_HANDLE_FORMAT "p"
|
||||
|
@ -53,9 +70,23 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(GstVulkanHandleTypedef)
|
|||
* Function definition called when the #GstVulkanHandle is no longer in use.
|
||||
* All implementations of this callback must free the internal handle stored
|
||||
* inside @handle.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef void (*GstVulkanHandleDestroyNotify) (GstVulkanHandle * handle, gpointer user_data);
|
||||
|
||||
/**
|
||||
* GstVulkanHandleType:
|
||||
* @GST_VULKAN_HANDLE_TYPE_DESCRIPTOR_SET_LAYOUT: descripter set layout
|
||||
* @GST_VULKAN_HANDLE_TYPE_PIPELINE_LAYOUT: pipeline layout
|
||||
* @GST_VULKAN_HANDLE_TYPE_PIPELINE: pipeline
|
||||
* @GST_VULKAN_HANDLE_TYPE_RENDER_PASS: render pass
|
||||
* @GST_VULKAN_HANDLE_TYPE_SAMPLER: sampler
|
||||
* @GST_VULKAN_HANDLE_TYPE_FRAMEBUFFER: framebuffer
|
||||
* @GST_VULKAN_HANDLE_TYPE_SHADER: shader
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GST_VULKAN_HANDLE_TYPE_DESCRIPTOR_SET_LAYOUT = 1,
|
||||
|
@ -74,7 +105,12 @@ typedef enum
|
|||
* @type: the type of handle
|
||||
* @handle: the handle value
|
||||
*
|
||||
* Holds information about a vulkan non dispatchable handle
|
||||
* Holds information about a vulkan non dispatchable handle that only has
|
||||
* a vulkan device as a parent and no specific host synchronisation
|
||||
* requirements. Command buffers have extra requirements that are serviced by
|
||||
* more specific implementations (#GstVulkanCommandBuffer, #GstVulkanCommandPool).
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanHandle
|
||||
{
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
|
||||
/**
|
||||
* SECTION:vulkanhandlepool
|
||||
* @title: vulkanhandlepool
|
||||
* @title: GstVulkanHandlePool
|
||||
* @short_description: Vulkan handle pool
|
||||
* @see_also: #GstVulkanHandle, #GstVulkanDevice
|
||||
*
|
||||
* #GstVulkanHandlePool holds a number of handles that are pooled together.
|
||||
*/
|
||||
|
|
|
@ -36,8 +36,22 @@ GType gst_vulkan_handle_pool_get_type (void);
|
|||
#define GST_IS_VULKAN_HANDLE_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VULKAN_HANDLE_POOL))
|
||||
#define GST_IS_VULKAN_HANDLE_POOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_VULKAN_HANDLE_POOL))
|
||||
#define GST_VULKAN_HANDLE_POOL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_HANDLE_POOL, GstVulkanHandlePoolClass))
|
||||
/**
|
||||
* GST_VULKAN_HANDLE_POOL_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_HANDLE_POOL_CAST(o) ((GstVulkanHandlePool *) o)
|
||||
|
||||
/**
|
||||
* GstVulkanHandlePool:
|
||||
* @parent: the parent #GstObject
|
||||
* @device: the #GstVulkanDevice handles are allocated from
|
||||
* @outstanding: the collection of outstanding handles
|
||||
* @available: the collection of allocated and available handles
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanHandlePool
|
||||
{
|
||||
GstObject parent;
|
||||
|
@ -52,6 +66,16 @@ struct _GstVulkanHandlePool
|
|||
gpointer _padding[GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanHandlePoolClass:
|
||||
* @parent: the parent #GstObjectClass
|
||||
* @alloc: allocate a new handle
|
||||
* @acquire: acquire a handle for usage
|
||||
* @release: release a handle for possible reuse at the next call to @acquire
|
||||
* @free: free a handle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanHandlePoolClass
|
||||
{
|
||||
GstObjectClass parent;
|
||||
|
@ -60,6 +84,9 @@ struct _GstVulkanHandlePoolClass
|
|||
gpointer (*acquire) (GstVulkanHandlePool * pool, GError ** error);
|
||||
void (*release) (GstVulkanHandlePool * pool, gpointer handle);
|
||||
void (*free) (GstVulkanHandlePool * pool, gpointer handle);
|
||||
|
||||
/* <private> */
|
||||
gpointer _padding[GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -34,28 +34,45 @@ GType gst_vulkan_image_buffer_pool_get_type (void);
|
|||
#define GST_TYPE_VULKAN_IMAGE_BUFFER_POOL (gst_vulkan_image_buffer_pool_get_type())
|
||||
#define GST_IS_VULKAN_IMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VULKAN_IMAGE_BUFFER_POOL))
|
||||
#define GST_VULKAN_IMAGE_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_IMAGE_BUFFER_POOL, GstVulkanImageBufferPool))
|
||||
|
||||
/**
|
||||
* GST_VULKAN_IMAGE_BUFFER_POOL_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_IMAGE_BUFFER_POOL_CAST(obj) ((GstVulkanImageBufferPool*)(obj))
|
||||
|
||||
/**
|
||||
* GstVulkanImageBufferPool:
|
||||
* @bufferpool: parent #GstBufferPool
|
||||
* @device: the #GstVulkanDevice to allocate images from
|
||||
*
|
||||
* Opaque GstVulkanImageBufferPool struct
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanImageBufferPool
|
||||
{
|
||||
GstBufferPool bufferpool;
|
||||
|
||||
GstVulkanDevice *device;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanImageBufferPoolClass:
|
||||
* @parent_class: parent #GstBufferPoolClass
|
||||
*
|
||||
* The #GstVulkanImageBufferPoolClass structure contains only private data
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanImageBufferPoolClass
|
||||
{
|
||||
GstBufferPoolClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* SECTION:vkimagememory
|
||||
* @title: GstVulkanImageMemory
|
||||
* @short_description: memory subclass for Vulkan image memory
|
||||
* @see_also: #GstMemory, #GstAllocator
|
||||
* @see_also: #GstVulkanDevice, #GstMemory, #GstAllocator
|
||||
*
|
||||
* GstVulkanImageMemory is a #GstMemory subclass providing support for the
|
||||
* mapping of Vulkan device memory.
|
||||
|
@ -473,7 +473,7 @@ gst_vulkan_image_memory_alloc (GstVulkanDevice * device, VkFormat format,
|
|||
* @tiling: tiling of @image
|
||||
* @usage: usage flags of @image
|
||||
* @user_data: (nullable): user data for @notify
|
||||
* @notify: a #DestroyNotify when @image is no longer needed
|
||||
* @notify: a #GDestroyNotify when @image is no longer needed
|
||||
*
|
||||
* Return: a new #GstVulkanImageMemory wrapping @image
|
||||
*
|
||||
|
|
|
@ -37,11 +37,34 @@ GType gst_vulkan_image_memory_allocator_get_type(void);
|
|||
#define GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanImageMemoryAllocatorClass))
|
||||
#define GST_VULKAN_IMAGE_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanImageMemoryAllocator))
|
||||
#define GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanImageMemoryAllocatorClass))
|
||||
/**
|
||||
* GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_CAST(obj) ((GstVulkanImageMemoryAllocator *)(obj))
|
||||
|
||||
/**
|
||||
* GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_NAME:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_IMAGE_MEMORY_ALLOCATOR_NAME "VulkanImage"
|
||||
/**
|
||||
* GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_CAPS_FEATURE_MEMORY_VULKAN_IMAGE "memory:VulkanImage"
|
||||
|
||||
/**
|
||||
* GstVulkanBarrierImageInfo:
|
||||
* @parent: parent #GstVulkanBarrierMemoryInfo
|
||||
* @image_layout: the image layout of this barrier
|
||||
* @subresource_range: what subresource the barrier applies to
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanBarrierImageInfo
|
||||
{
|
||||
GstVulkanBarrierMemoryInfo parent;
|
||||
|
@ -51,6 +74,20 @@ struct _GstVulkanBarrierImageInfo
|
|||
VkImageSubresourceRange subresource_range;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanImageMemory:
|
||||
* @parent: parent #GstMemory
|
||||
* @device: the #GstVulkanDevice to allocate images from
|
||||
* @image: the Vulkan image handle
|
||||
* @vk_mem: the backing #GstVulkanMemory for @image
|
||||
* @create_info: creation information for @image
|
||||
* @requirements: memory requirements for @image
|
||||
* @format_properties: format properties
|
||||
* @usage: intended usage for @image
|
||||
* @barrier: last set barrier for @image
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanImageMemory
|
||||
{
|
||||
GstMemory parent;
|
||||
|
@ -67,6 +104,7 @@ struct _GstVulkanImageMemory
|
|||
|
||||
GstVulkanBarrierImageInfo barrier;
|
||||
|
||||
/* <private> */
|
||||
GMutex lock;
|
||||
gboolean wrapped;
|
||||
GDestroyNotify notify;
|
||||
|
@ -83,27 +121,41 @@ struct _GstVulkanImageMemory
|
|||
*
|
||||
* Function definition used to find views. Return %TRUE if @view matches the
|
||||
* criteria.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef gboolean (*GstVulkanImageMemoryFindViewFunc) (GstVulkanImageView * view, gpointer user_data);
|
||||
|
||||
/**
|
||||
* GstVulkanImageMemoryAllocator
|
||||
* @parent: the parent #GstAllocator
|
||||
*
|
||||
* Opaque #GstVulkanImageMemoryAllocator struct
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanImageMemoryAllocator
|
||||
{
|
||||
GstAllocator parent;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanImageMemoryAllocatorClass:
|
||||
* @parent_class: the parent #GstAllocatorClass
|
||||
*
|
||||
* The #GstVulkanImageMemoryAllocatorClass only contains private data
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanImageMemoryAllocatorClass
|
||||
{
|
||||
GstAllocatorClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
* SECTION:vkimageview
|
||||
* @title: GstVulkanImageView
|
||||
* @short_description: wrapper for `VkImageView`'s
|
||||
* @see_also: #GstVulkanImageMemory
|
||||
* @see_also: #GstVulkanImageMemory, #GstVulkanDevice
|
||||
*
|
||||
* #GstVulkanImageView is a wrapper around a `VkImageView` mostly for
|
||||
* usage across element boundaries with #GstVulkanImageMemory
|
||||
|
@ -91,6 +91,8 @@ gst_vulkan_image_view_free (GstVulkanImageView * view)
|
|||
*
|
||||
* Returns: (transfer full): A new #GstVulkanImageView from @image and
|
||||
* @create_info
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanImageView *
|
||||
gst_vulkan_image_view_new (GstVulkanImageMemory * image,
|
||||
|
|
|
@ -25,10 +25,30 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GST_TYPE_VULKAN_IMAGE_VIEW:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_TYPE_VULKAN_IMAGE_VIEW (gst_vulkan_image_view_get_type())
|
||||
GST_VULKAN_API
|
||||
/**
|
||||
* gst_vulkan_image_view_get_type:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GType gst_vulkan_image_view_get_type(void);
|
||||
|
||||
/**
|
||||
* GstVulkanImageView:
|
||||
* @parent: the parent #GstMiniObject
|
||||
* @device: the #GstVulkanDevice
|
||||
* @image: the associated #GstVulkanImageMemory for this view
|
||||
* @view: the vulkan image view handle
|
||||
* @create_info: the creation information for this view
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanImageView
|
||||
{
|
||||
GstMiniObject parent;
|
||||
|
@ -39,6 +59,9 @@ struct _GstVulkanImageView
|
|||
VkImageView view;
|
||||
|
||||
VkImageViewCreateInfo create_info;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -48,6 +71,8 @@ struct _GstVulkanImageView
|
|||
* Increases the refcount of the given trash object by one.
|
||||
*
|
||||
* Returns: (transfer full): @trash
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline GstVulkanImageView* gst_vulkan_image_view_ref(GstVulkanImageView* trash);
|
||||
static inline GstVulkanImageView *
|
||||
|
@ -62,6 +87,8 @@ gst_vulkan_image_view_ref (GstVulkanImageView * trash)
|
|||
*
|
||||
* Decreases the refcount of the trash object. If the refcount reaches 0, the
|
||||
* trash will be freed.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline void gst_vulkan_image_view_unref(GstVulkanImageView* trash);
|
||||
static inline void
|
||||
|
@ -70,6 +97,26 @@ gst_vulkan_image_view_unref (GstVulkanImageView * trash)
|
|||
gst_mini_object_unref (GST_MINI_OBJECT_CAST (trash));
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_clear_vulkan_image_view: (skip)
|
||||
* @view_ptr: a pointer to a #GstVulkanImageView reference
|
||||
*
|
||||
* Clears a reference to a #GstVulkanImageView.
|
||||
*
|
||||
* @view_ptr must not be %NULL.
|
||||
*
|
||||
* If the reference is %NULL then this function does nothing. Otherwise, the
|
||||
* reference count of the descriptor set is decreased and the pointer is set
|
||||
* to %NULL.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline void
|
||||
gst_clear_vulkan_image_view (GstVulkanImageView ** view_ptr)
|
||||
{
|
||||
gst_clear_mini_object ((GstMiniObject **) view_ptr);
|
||||
}
|
||||
|
||||
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVulkanImageView, gst_vulkan_image_view_unref)
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
* SECTION:vkinstance
|
||||
* @title: GstVulkanInstance
|
||||
* @short_description: GStreamer Vulkan instance
|
||||
* @see_also: #GstVulkanPhysicalDevice, #GstVulkanDevice
|
||||
* @see_also: #GstVulkanPhysicalDevice, #GstVulkanDevice, #GstVulkanDisplay
|
||||
*
|
||||
* #GstVulkanInstance encapsulates the necessary information for the toplevel
|
||||
* Vulkan instance object.
|
||||
|
@ -115,6 +115,13 @@ G_DEFINE_TYPE_WITH_CODE (GstVulkanInstance, gst_vulkan_instance,
|
|||
GST_TYPE_OBJECT, G_ADD_PRIVATE (GstVulkanInstance)
|
||||
_init_debug ());
|
||||
|
||||
/**
|
||||
* gst_vulkan_instance_new:
|
||||
*
|
||||
* Returns: (transfer full): a new uninitialized #GstVulkanInstance
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanInstance *
|
||||
gst_vulkan_instance_new (void)
|
||||
{
|
||||
|
@ -220,6 +227,11 @@ gst_vulkan_instance_class_init (GstVulkanInstanceClass * klass)
|
|||
gobject_class->set_property = gst_vulkan_instance_set_property;
|
||||
gobject_class->finalize = gst_vulkan_instance_finalize;
|
||||
|
||||
/**
|
||||
* GstVulkanInstance:requested-api-major:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_REQUESTED_API_MAJOR_VERSION,
|
||||
g_param_spec_uint ("requested-api-major", "Requested API Major",
|
||||
|
@ -227,6 +239,11 @@ gst_vulkan_instance_class_init (GstVulkanInstanceClass * klass)
|
|||
0, G_MAXUINT, DEFAULT_REQUESTED_API_VERSION_MAJOR,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
/**
|
||||
* GstVulkanInstance:requested-api-minor:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_REQUESTED_API_MINOR_VERSION,
|
||||
g_param_spec_uint ("requested-api-minor", "Requested API Minor",
|
||||
|
@ -473,6 +490,8 @@ gst_vulkan_instance_is_extension_enabled_unlocked (GstVulkanInstance * instance,
|
|||
* @name: extension name
|
||||
*
|
||||
* Returns: whether extension @name is enabled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_instance_is_extension_enabled (GstVulkanInstance * instance,
|
||||
|
@ -528,6 +547,8 @@ gst_vulkan_instance_enable_extension_unlocked (GstVulkanInstance * instance,
|
|||
* only have an effect before the call to gst_vulkan_instance_open().
|
||||
*
|
||||
* Returns: whether the Vulkan extension could be enabled.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_instance_enable_extension (GstVulkanInstance * instance,
|
||||
|
@ -581,6 +602,8 @@ gst_vulkan_instance_disable_extension_unlocked (GstVulkanInstance * instance,
|
|||
* an effect before the call to gst_vulkan_instance_open().
|
||||
*
|
||||
* Returns: whether the Vulkan extension could be disabled.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_instance_disable_extension (GstVulkanInstance * instance,
|
||||
|
@ -613,6 +636,8 @@ gst_vulkan_instance_is_layer_enabled_unlocked (GstVulkanInstance * instance,
|
|||
* @name: layer name
|
||||
*
|
||||
* Returns: whether layer @name is enabled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_instance_is_layer_enabled (GstVulkanInstance * instance,
|
||||
|
@ -667,6 +692,8 @@ gst_vulkan_instance_enable_layer_unlocked (GstVulkanInstance * instance,
|
|||
* only have an effect before the call to gst_vulkan_instance_open().
|
||||
*
|
||||
* Returns: whether the Vulkan layer could be enabled.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_instance_enable_layer (GstVulkanInstance * instance,
|
||||
|
@ -1034,7 +1061,7 @@ error:
|
|||
* @instance: a #GstVulkanInstance
|
||||
* @name: name of the function to retrieve
|
||||
*
|
||||
* Performs vkGetInstanceProcAddr() with @instance and @name
|
||||
* Performs `vkGetInstanceProcAddr()` with @instance and @name
|
||||
*
|
||||
* Returns: the function pointer for @name or %NULL
|
||||
*
|
||||
|
@ -1059,7 +1086,7 @@ gst_vulkan_instance_get_proc_address (GstVulkanInstance * instance,
|
|||
|
||||
/**
|
||||
* gst_vulkan_instance_create_device:
|
||||
* @instance: a #GstVulkanIncstance
|
||||
* @instance: a #GstVulkanInstance
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanDevice
|
||||
*
|
||||
|
|
|
@ -34,8 +34,22 @@ G_BEGIN_DECLS
|
|||
GST_VULKAN_API
|
||||
GType gst_vulkan_instance_get_type (void);
|
||||
|
||||
/**
|
||||
* GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_INSTANCE_CONTEXT_TYPE_STR "gst.vulkan.instance"
|
||||
|
||||
/**
|
||||
* GstVulkanInstance:
|
||||
* @parent: parent #GstObject
|
||||
* @instance: the Vulkan instance handle
|
||||
* @physical_devices: list of vulkan physical device handles
|
||||
* @n_physical_device: number of entries in @physical_devices
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanInstance
|
||||
{
|
||||
GstObject parent;
|
||||
|
@ -43,11 +57,23 @@ struct _GstVulkanInstance
|
|||
VkInstance instance; /* hides a pointer */
|
||||
VkPhysicalDevice *physical_devices; /* hides a pointer */
|
||||
guint32 n_physical_devices;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanInstanceClass:
|
||||
* @parent_class: parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanInstanceClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
* SECTION:vkmemory
|
||||
* @title: GstVulkanMemory
|
||||
* @short_description: memory subclass for Vulkan device memory
|
||||
* @see_also: #GstMemory, #GstAllocator
|
||||
* @see_also: #GstVulkanDevice, #GstMemory, #GstAllocator
|
||||
*
|
||||
* GstVulkanMemory is a #GstMemory subclass providing support for the mapping of
|
||||
* Vulkan device memory.
|
||||
|
|
|
@ -38,10 +38,30 @@ GType gst_vulkan_memory_allocator_get_type(void);
|
|||
#define GST_VULKAN_MEMORY_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanMemoryAllocatorClass))
|
||||
#define GST_VULKAN_MEMORY_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanMemoryAllocator))
|
||||
#define GST_VULKAN_MEMORY_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VULKAN_MEMORY_ALLOCATOR, GstVulkanMemoryAllocatorClass))
|
||||
/**
|
||||
* GST_VULKAN_MEMORY_ALLOCATOR_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_MEMORY_ALLOCATOR_CAST(obj) ((GstVulkanMemoryAllocator *)(obj))
|
||||
|
||||
/**
|
||||
* GST_VULKAN_MEMORY_ALLOCATOR_NAME:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_MEMORY_ALLOCATOR_NAME "Vulkan"
|
||||
|
||||
/**
|
||||
* GstVulkanMemory
|
||||
* @mem: the parent #GstMemory
|
||||
* @device: the #GstVulkanDevice this memory is allocated from
|
||||
* @mem_ptr: the vulkan memory handle
|
||||
* @lock: lock for accessing/changing memory informat
|
||||
* @map_count: number of times this memory is mapped
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanMemory
|
||||
{
|
||||
GstMemory mem;
|
||||
|
@ -66,26 +86,41 @@ struct _GstVulkanMemory
|
|||
* relation to the root memory */
|
||||
guint64 vk_offset;
|
||||
gboolean wrapped;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanMemoryAllocator
|
||||
* @parent: the parent #GstAllocator
|
||||
*
|
||||
* Opaque #GstVulkanMemoryAllocator struct
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanMemoryAllocator
|
||||
{
|
||||
GstAllocator parent;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanMemoryAllocatorClass:
|
||||
* @parent_class: the parent #GstAllocatorClass
|
||||
*
|
||||
* The #GstVulkanMemoryAllocatorClass only contains private data
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanMemoryAllocatorClass
|
||||
{
|
||||
GstAllocatorClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -35,6 +35,20 @@ G_BEGIN_DECLS
|
|||
GST_VULKAN_API
|
||||
GType gst_vulkan_physical_device_get_type (void);
|
||||
|
||||
/**
|
||||
* GstVulkanPhysicalDevice:
|
||||
* @parent: the parent #GstObject
|
||||
* @instance: the parent #GstVulkanInstance for this physical device
|
||||
* @device_index: the index into the physical device list in @instance
|
||||
* @device: the vulkan physical device handle
|
||||
* @properties: retrieved physical device properties
|
||||
* @features: retrieved physical device features
|
||||
* @memory_properties: retrieved physical device memory properties
|
||||
* @queue_family_props: vulkan family properties
|
||||
* @n_queue_families: number of elements in @queue_family_props
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanPhysicalDevice
|
||||
{
|
||||
GstObject parent;
|
||||
|
@ -50,11 +64,23 @@ struct _GstVulkanPhysicalDevice
|
|||
|
||||
VkQueueFamilyProperties *queue_family_props;
|
||||
guint32 n_queue_families;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanPhysicalDeviceClass:
|
||||
* @parent_class: the parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanPhysicalDeviceClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -311,6 +311,8 @@ gst_vulkan_queue_run_context_query (GstElement * element,
|
|||
*
|
||||
* Locks the queue for command submission using `vkQueueSubmit()` to meet the
|
||||
* Vulkan requirements for externally synchronised resources.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_queue_submit_lock (GstVulkanQueue * queue)
|
||||
|
@ -327,6 +329,8 @@ gst_vulkan_queue_submit_lock (GstVulkanQueue * queue)
|
|||
* Unlocks the queue for command submission using `vkQueueSubmit()`.
|
||||
*
|
||||
* See gst_vulkan_queue_submit_lock() for details on when this call is needed.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_queue_submit_unlock (GstVulkanQueue * queue)
|
||||
|
|
|
@ -33,8 +33,23 @@
|
|||
GST_VULKAN_API
|
||||
GType gst_vulkan_queue_get_type (void);
|
||||
|
||||
/**
|
||||
* GST_VULKAN_QUEUE_CONTEXT_TYPE_STR:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_QUEUE_CONTEXT_TYPE_STR "gst.vulkan.queue"
|
||||
|
||||
/**
|
||||
* GstVulkanQueue:
|
||||
* @parent: the parent #GstObject
|
||||
* @device: the #GstVulkanDevice this queue was allocated from
|
||||
* @queue: the vulkan queue handle
|
||||
* @family: the vulkan queue family
|
||||
* @index: the vulkan queue index
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanQueue
|
||||
{
|
||||
GstObject parent;
|
||||
|
@ -44,11 +59,23 @@ struct _GstVulkanQueue
|
|||
VkQueue queue; /* hides a pointer */
|
||||
guint32 family;
|
||||
guint32 index;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanQueueClass:
|
||||
* @parent_class: the parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanQueueClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -26,6 +26,16 @@
|
|||
|
||||
#include "gstvkswapper.h"
|
||||
|
||||
/**
|
||||
* SECTION:vkswapper
|
||||
* @title: GstVulkanSwapper
|
||||
* @short_description: Vulkan helper object for rendering to a surface
|
||||
* @see_also: #GstVulkanWindow, #GstVulkanQueue
|
||||
*
|
||||
* #GstVulkanSwapper is a helper object for rendering to a surface exposed by
|
||||
* #GstVulkanWindow.
|
||||
*/
|
||||
|
||||
#define GST_CAT_DEFAULT gst_vulkan_swapper_debug
|
||||
GST_DEBUG_CATEGORY (GST_CAT_DEFAULT);
|
||||
|
||||
|
@ -1449,6 +1459,8 @@ _on_window_resize (GstVulkanWindow * window, guint width, guint height,
|
|||
* output surface is located relative to its parent
|
||||
* @display_rect: (out) (nullable): The #GstVideoRectangle for where the input
|
||||
* images are placed inside @surface_location
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_swapper_get_surface_rectangles (GstVulkanSwapper * swapper,
|
||||
|
|
|
@ -36,12 +36,27 @@ G_BEGIN_DECLS
|
|||
GST_VULKAN_API
|
||||
GType gst_vulkan_swapper_get_type (void);
|
||||
|
||||
/**
|
||||
* GST_VULKAN_SWAPPER_VIDEO_FORMATS:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_SWAPPER_VIDEO_FORMATS " { RGBA, BGRA, RGB, BGR } "
|
||||
|
||||
typedef struct _GstVulkanSwapper GstVulkanSwapper;
|
||||
typedef struct _GstVulkanSwapperClass GstVulkanSwapperClass;
|
||||
typedef struct _GstVulkanSwapperPrivate GstVulkanSwapperPrivate;
|
||||
|
||||
/**
|
||||
* GstVulkanSwapper:
|
||||
* @parent: parent #GstObject
|
||||
* @device: the #GstVulkanDevice
|
||||
* @window: the #GstVulkanWindow to display into
|
||||
* @queue: the #GstVulkanQueue to display with
|
||||
* @cmd_pool: the #GstVulkanCommandPool to allocate command buffers from
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanSwapper
|
||||
{
|
||||
GstObject parent;
|
||||
|
@ -50,11 +65,23 @@ struct _GstVulkanSwapper
|
|||
GstVulkanWindow *window;
|
||||
GstVulkanQueue *queue;
|
||||
GstVulkanCommandPool *cmd_pool;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanSwapperClass:
|
||||
* @parent_class: parent #GstObjectClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanSwapperClass
|
||||
{
|
||||
GstObjectClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -25,6 +25,16 @@
|
|||
#include "gstvktrash.h"
|
||||
#include "gstvkhandle.h"
|
||||
|
||||
/**
|
||||
* SECTION:vktrash
|
||||
* @title: GstVulkanTrash
|
||||
* @short_description: Vulkan helper object for freeing resources after a #GstVulkanFence is signalled
|
||||
* @see_also: #GstVulkanFence, #GstVulkanQueue
|
||||
*
|
||||
* #GstVulkanTrash is a helper object for freeing resources after a
|
||||
* #GstVulkanFence is signalled.
|
||||
*/
|
||||
|
||||
GST_DEBUG_CATEGORY (gst_debug_vulkan_trash);
|
||||
#define GST_CAT_DEFAULT gst_debug_vulkan_trash
|
||||
|
||||
|
@ -115,6 +125,8 @@ gst_vulkan_trash_init (GstVulkanTrash * trash, GstVulkanFence * fence,
|
|||
* to call when @fence is signalled.
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanTrash
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanTrash *
|
||||
gst_vulkan_trash_new (GstVulkanFence * fence, GstVulkanTrashNotify notify,
|
||||
|
@ -175,6 +187,16 @@ G_PASTE(gst_vulkan_trash_new_free_,type_name) (GstVulkanFence * fence, \
|
|||
return trash; \
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_new_free_semaphore:
|
||||
* @fence: the #GstVulkanFence
|
||||
* @semaphore: a `VkSemaphore` to free
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanTrash object that will the free
|
||||
* @semaphore when @fence is signalled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
FREE_DESTROY_FUNC (vkDestroySemaphore, VkSemaphore, semaphore);
|
||||
#define FREE_WITH_VK_PARENT(func, type, type_name, parent_type) \
|
||||
struct G_PASTE(free_parent_info_,type_name) \
|
||||
|
@ -206,12 +228,32 @@ G_PASTE(gst_vulkan_trash_new_free_,type_name) (GstVulkanFence * fence, \
|
|||
return trash; \
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_object_unref:
|
||||
* @device: the #GstVulkanDevice
|
||||
* @user_data: the #GstMiniObject
|
||||
*
|
||||
* A #GstVulkanTrashNotify implementation for unreffing a #GstObject when the
|
||||
* associated #GstVulkanFence is signalled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_trash_object_unref (GstVulkanDevice * device, gpointer user_data)
|
||||
{
|
||||
gst_object_unref ((GstObject *) user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_mini_object_unref:
|
||||
* @device: the #GstVulkanDevice
|
||||
* @user_data: the #GstMiniObject
|
||||
*
|
||||
* A #GstVulkanTrashNotify implementation for unreffing a #GstMiniObject when the
|
||||
* associated #GstVulkanFence is signalled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_trash_mini_object_unref (GstVulkanDevice * device,
|
||||
gpointer user_data)
|
||||
|
@ -222,6 +264,15 @@ gst_vulkan_trash_mini_object_unref (GstVulkanDevice * device,
|
|||
G_DEFINE_TYPE_WITH_CODE (GstVulkanTrashList, gst_vulkan_trash_list,
|
||||
GST_TYPE_VULKAN_HANDLE_POOL, _init_debug ());
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_list_gc:
|
||||
* @trash_list: the #GstVulkanTrashList
|
||||
*
|
||||
* Remove any stored #GstVulkanTrash objects that have had their associated
|
||||
* #GstVulkanFence signalled.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_trash_list_gc (GstVulkanTrashList * trash_list)
|
||||
{
|
||||
|
@ -233,6 +284,15 @@ gst_vulkan_trash_list_gc (GstVulkanTrashList * trash_list)
|
|||
trash_class->gc_func (trash_list);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_list_add:
|
||||
* @trash_list: the #GstVulkanTrashList
|
||||
* @trash: #GstVulkanTrash object to add to the list
|
||||
*
|
||||
* Returns: whether @trash could be added to @trash_list
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_trash_list_add (GstVulkanTrashList * trash_list,
|
||||
GstVulkanTrash * trash)
|
||||
|
@ -245,6 +305,15 @@ gst_vulkan_trash_list_add (GstVulkanTrashList * trash_list,
|
|||
return trash_class->add_func (trash_list, trash);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_list_wait:
|
||||
* @trash_list: the #GstVulkanTrashList
|
||||
* @timeout: timeout in ns to wait, -1 for indefinite
|
||||
*
|
||||
* Returns: whether the wait succeeded in waiting for all objects to be freed.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
gboolean
|
||||
gst_vulkan_trash_list_wait (GstVulkanTrashList * trash_list, guint64 timeout)
|
||||
{
|
||||
|
@ -308,6 +377,8 @@ gst_vulkan_trash_list_init (GstVulkanTrashList * trash_list)
|
|||
*
|
||||
* Returns: (transfer full): a new or reused #GstVulkanTrash for the provided
|
||||
* parameters.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanTrash *
|
||||
gst_vulkan_trash_list_acquire (GstVulkanTrashList * trash_list,
|
||||
|
@ -451,6 +522,13 @@ gst_vulkan_trash_fence_list_init (GstVulkanTrashFenceList * trash_list)
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_fence_list_new:
|
||||
*
|
||||
* Returns: (transfer full): a new #gst_vulkan_trash_fence_list_new
|
||||
*
|
||||
* Since: a.18
|
||||
*/
|
||||
GstVulkanTrashList *
|
||||
gst_vulkan_trash_fence_list_new (void)
|
||||
{
|
||||
|
|
|
@ -25,8 +25,20 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GstVulkanTrashNotify:
|
||||
* @device: the #GstVulkanDevice
|
||||
* @user_data: user data
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef void (*GstVulkanTrashNotify) (GstVulkanDevice * device, gpointer user_data);
|
||||
|
||||
/**
|
||||
* GstVulkanTrash:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanTrash
|
||||
{
|
||||
GstMiniObject parent;
|
||||
|
@ -42,6 +54,11 @@ struct _GstVulkanTrash
|
|||
gpointer _padding[GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GST_TYPE_VULKAN_TRASH:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_TYPE_VULKAN_TRASH gst_vulkan_trash_get_type()
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_trash_get_type (void);
|
||||
|
@ -53,6 +70,8 @@ GType gst_vulkan_trash_get_type (void);
|
|||
* Increases the refcount of the given trash object by one.
|
||||
*
|
||||
* Returns: (transfer full): @trash
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline GstVulkanTrash* gst_vulkan_trash_ref(GstVulkanTrash* trash);
|
||||
static inline GstVulkanTrash *
|
||||
|
@ -67,6 +86,8 @@ gst_vulkan_trash_ref (GstVulkanTrash * trash)
|
|||
*
|
||||
* Decreases the refcount of the trash object. If the refcount reaches 0, the
|
||||
* trash will be freed.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline void gst_vulkan_trash_unref(GstVulkanTrash* trash);
|
||||
static inline void
|
||||
|
@ -93,6 +114,16 @@ GST_VULKAN_API
|
|||
GstVulkanTrash * gst_vulkan_trash_new_free_semaphore (GstVulkanFence * fence,
|
||||
VkSemaphore semaphore);
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_new_object_unref:
|
||||
* @fence: the #GstVulkanFence
|
||||
* @object: a #GstObject to unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanTrash object that will the unref
|
||||
* @object when @fence is signalled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline GstVulkanTrash *
|
||||
gst_vulkan_trash_new_object_unref (GstVulkanFence * fence, GstObject * object)
|
||||
{
|
||||
|
@ -101,6 +132,16 @@ gst_vulkan_trash_new_object_unref (GstVulkanFence * fence, GstObject * object)
|
|||
(GstVulkanTrashNotify) gst_vulkan_trash_object_unref, (gpointer) object);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_trash_new_mini_object_unref:
|
||||
* @fence: the #GstVulkanFence
|
||||
* @object: a #GstMiniObject to unref
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanTrash object that will the unref
|
||||
* @object when @fence is signalled
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
static inline GstVulkanTrash *
|
||||
gst_vulkan_trash_new_mini_object_unref (GstVulkanFence * fence, GstMiniObject * object)
|
||||
{
|
||||
|
@ -110,6 +151,11 @@ gst_vulkan_trash_new_mini_object_unref (GstVulkanFence * fence, GstMiniObject *
|
|||
|
||||
GST_VULKAN_API
|
||||
GType gst_vulkan_trash_list_get_type (void);
|
||||
/**
|
||||
* GST_TYPE_VULKAN_TRASH_LIST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_TYPE_VULKAN_TRASH_LIST gst_vulkan_trash_list_get_type()
|
||||
#define GST_VULKAN_TRASH_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VULKAN_TRASH_LIST,GstVulkanTrashList))
|
||||
#define GST_VULKAN_TRASH_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_VULKAN_TRASH_LIST,GstVulkanTrashListClass))
|
||||
|
@ -121,15 +167,66 @@ GType gst_vulkan_trash_list_get_type (void);
|
|||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVulkanTrashList, gst_object_unref)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* GstVulkanTrashList:
|
||||
* @parent: the parent #GstVulkanHandle
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanTrashList
|
||||
{
|
||||
GstVulkanHandlePool parent;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanTrashListGC:
|
||||
* @trash_list: the #GstVulkanTrashList instance
|
||||
*
|
||||
* Remove any memory allocated by any signalled objects.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef void (*GstVulkanTrashListGC) (GstVulkanTrashList * trash_list);
|
||||
|
||||
/**
|
||||
* GstVulkanTrashListAdd:
|
||||
* @trash_list: the #GstVulkanTrashList instance
|
||||
* @trash: the #GstVulkanTrash to add to @trash_list
|
||||
*
|
||||
* Add @trash to @trash_list for tracking
|
||||
*
|
||||
* Returns: whether @trash could be added to @trash_list
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef gboolean (*GstVulkanTrashListAdd) (GstVulkanTrashList * trash_list, GstVulkanTrash * trash);
|
||||
|
||||
/**
|
||||
* GstVulkanTrashListWait:
|
||||
* @trash_list: the #GstVulkanTrashList instance
|
||||
* @timeout: the timeout in ns to wait
|
||||
*
|
||||
* Wait for a most @timeout to pass for all #GstVulkanTrash objects to be
|
||||
* signalled and freed.
|
||||
*
|
||||
* Returns: whether all objects were signalled and freed within the @timeout
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef gboolean (*GstVulkanTrashListWait) (GstVulkanTrashList * trash_list, guint64 timeout);
|
||||
|
||||
/**
|
||||
* GstVulkanTrashListClass:
|
||||
* @parent_class: the #GstVulkanHandlePoolClass
|
||||
* @add_func: the #GstVulkanTrashListAdd functions
|
||||
* @gc_func: the #GstVulkanTrashListGC function
|
||||
* @wait_func: the #GstVulkanTrashListWait function
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanTrashListClass
|
||||
{
|
||||
GstVulkanHandlePoolClass parent_class;
|
||||
|
@ -138,7 +235,8 @@ struct _GstVulkanTrashListClass
|
|||
GstVulkanTrashListGC gc_func;
|
||||
GstVulkanTrashListWait wait_func;
|
||||
|
||||
gpointer _padding[GST_PADDING];
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
@ -154,7 +252,16 @@ GstVulkanTrash * gst_vulkan_trash_list_acquire (GstVulkanTr
|
|||
GstVulkanFence * fence,
|
||||
GstVulkanTrashNotify notify,
|
||||
gpointer user_data);
|
||||
|
||||
/**
|
||||
* GstVulkanTrashFenceList:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
/**
|
||||
* GstVulkanTrashFenceListClass:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GST_VULKAN_API
|
||||
G_DECLARE_FINAL_TYPE (GstVulkanTrashFenceList, gst_vulkan_trash_fence_list, GST, VULKAN_TRASH_FENCE_LIST, GstVulkanTrashList);
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
* @title: Vulkan Utils
|
||||
* @short_description: Vulkan utilities
|
||||
* @see_also: #GstVulkanInstance, #GstVulkanDevice
|
||||
*
|
||||
* GstVulkanQueue encapsulates the vulkan command queue.
|
||||
*/
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
||||
|
@ -457,6 +455,15 @@ find_compatible_view (GstVulkanImageView * view, VkImageViewCreateInfo * info)
|
|||
info->subresourceRange.layerCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_get_or_create_image_view
|
||||
* @image: a #GstVulkanImageMemory
|
||||
*
|
||||
* Returns: (transfer full): a #GstVulkanImageView for @image matching the
|
||||
* original layout and format of @image
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanImageView *
|
||||
gst_vulkan_get_or_create_image_view (GstVulkanImageMemory * image)
|
||||
{
|
||||
|
@ -479,6 +486,18 @@ gst_vulkan_get_or_create_image_view (GstVulkanImageMemory * image)
|
|||
#define SPIRV_MAGIC_NUMBER_NE 0x07230203
|
||||
#define SPIRV_MAGIC_NUMBER_OE 0x03022307
|
||||
|
||||
/**
|
||||
* gst_vulkan_create_shader
|
||||
* @device: a #GstVulkanDevice
|
||||
* @code: the SPIR-V shader byte code
|
||||
* @size: length of @code. Must be a multiple of 4
|
||||
* @error: a #GError to fill on failure
|
||||
*
|
||||
* Returns: (transfer full): a #GstVulkanHandle for @image matching the
|
||||
* original layout and format of @image or %NULL
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanHandle *
|
||||
gst_vulkan_create_shader (GstVulkanDevice * device, gchar * code, gsize size,
|
||||
GError ** error)
|
||||
|
|
|
@ -20,9 +20,11 @@
|
|||
|
||||
/**
|
||||
* SECTION:vulkanvideofilter
|
||||
* @title: vulkanvideofilter
|
||||
* @title: GstVulkanVideoFilter
|
||||
* @short_description: Vulkan filter base class
|
||||
* @see_also: #GstVulkanInstance, #GstVulkanDevice
|
||||
*
|
||||
* vulkanvideofilter is a helper base class for retrieving and holding the
|
||||
* #GstVulkanVideoFilter is a helper base class for retrieving and holding the
|
||||
* #GstVulkanInstance, #GstVulkanDevice and #GstVulkanQueue used by an element.
|
||||
*/
|
||||
|
||||
|
@ -104,8 +106,6 @@ gst_vulkan_video_filter_class_init (GstVulkanVideoFilterClass * klass)
|
|||
gst_vulkan_video_filter_propose_allocation;
|
||||
gstbasetransform_class->decide_allocation =
|
||||
gst_vulkan_video_filter_decide_allocation;
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_VULKAN_VIDEO_FILTER, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -39,6 +39,19 @@ GType gst_vulkan_video_filter_get_type(void);
|
|||
typedef struct _GstVulkanVideoFilter GstVulkanVideoFilter;
|
||||
typedef struct _GstVulkanVideoFilterClass GstVulkanVideoFilterClass;
|
||||
|
||||
/**
|
||||
* GstVulkanVideoFilter:
|
||||
* @parent: the parent #GstBaseTransform
|
||||
* @instance: the configured #GstVulkanInstance
|
||||
* @device: the configured #GstVulkanDevice
|
||||
* @queue: the configured #GstVulkanQueue
|
||||
* @in_caps: the configured input #GstCaps
|
||||
* @in_info: the configured input #GstVideoInfo
|
||||
* @out_caps: the configured output #GstCaps
|
||||
* @out_info: the configured output #GstVideoInfo
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanVideoFilter
|
||||
{
|
||||
GstBaseTransform parent;
|
||||
|
@ -51,11 +64,23 @@ struct _GstVulkanVideoFilter
|
|||
GstVideoInfo in_info;
|
||||
GstCaps *out_caps;
|
||||
GstVideoInfo out_info;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanVideoFilterClass:
|
||||
* @parent_class: the parent #GstBaseTransformClass
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanVideoFilterClass
|
||||
{
|
||||
GstBaseTransformClass video_sink_class;
|
||||
GstBaseTransformClass parent_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* SECTION:vkwindow
|
||||
* @title: GstVulkanWindow
|
||||
* @short_description: window/surface abstraction
|
||||
* @see_also: #GstVulkanDisplay
|
||||
* @see_also: #GstVulkanDisplay, #GstVulkanSwapper
|
||||
*
|
||||
* GstVulkanWindow represents a window that elements can render into. A window can
|
||||
* either be a user visible window (onscreen) or hidden (offscreen).
|
||||
|
@ -535,6 +535,8 @@ gst_vulkan_window_send_mouse_event (GstVulkanWindow * window,
|
|||
* events are not propagated in the window hierarchy if a client is listening
|
||||
* for them. This method allows you to disable events handling completely
|
||||
* from the @window.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
void
|
||||
gst_vulkan_window_handle_events (GstVulkanWindow * window,
|
||||
|
|
|
@ -36,14 +36,47 @@ G_BEGIN_DECLS
|
|||
GST_VULKAN_API
|
||||
GType gst_vulkan_window_get_type (void);
|
||||
|
||||
/**
|
||||
* GST_VULKAN_WINDOW_LOCK:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_WINDOW_LOCK(w) g_mutex_lock(&GST_VULKAN_WINDOW(w)->lock)
|
||||
/**
|
||||
* GST_VULKAN_WINDOW_UNLOCK:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_WINDOW_UNLOCK(w) g_mutex_unlock(&GST_VULKAN_WINDOW(w)->lock)
|
||||
/**
|
||||
* GST_VULKAN_WINDOW_GET_LOCK:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_WINDOW_GET_LOCK(w) (&GST_VULKAN_WINDOW(w)->lock)
|
||||
|
||||
/**
|
||||
* GST_VULKAN_WINDOW_ERROR:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_WINDOW_ERROR (gst_vulkan_window_error_quark ())
|
||||
/**
|
||||
* gst_vulkan_window_error_quark:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GST_VULKAN_API
|
||||
GQuark gst_vulkan_window_error_quark (void);
|
||||
|
||||
/**
|
||||
* GstVulkanWindowError:
|
||||
* @GST_VULKAN_WINDOW_ERROR_FAILED: failed
|
||||
* @GST_VULKAN_WINDOW_ERROR_OLD_LIBS: old libraries
|
||||
* @GST_VULKAN_WINDOW_ERROR_RESOURCE_UNAVAILABLE: resource unavailable
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GST_VULKAN_WINDOW_ERROR_FAILED,
|
||||
|
@ -56,6 +89,8 @@ typedef enum
|
|||
*
|
||||
* #GstVulkanWindow is an opaque struct and should only be accessed through the
|
||||
* provided api.
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanWindow {
|
||||
/*< private >*/
|
||||
|
@ -63,7 +98,7 @@ struct _GstVulkanWindow {
|
|||
|
||||
GstVulkanDisplay *display;
|
||||
|
||||
GMutex lock;
|
||||
// GMutex lock;
|
||||
|
||||
gpointer _reserved[GST_PADDING];
|
||||
};
|
||||
|
@ -73,6 +108,13 @@ struct _GstVulkanWindow {
|
|||
* @parent_class: Parent class
|
||||
* @open: open the connection to the display
|
||||
* @close: close the connection to the display
|
||||
* @get_surface: retrieve the vulkan surface for this window
|
||||
* @get_presentation_support: retrieve whether this window supports presentation
|
||||
* @set_window_handle: set the external window handle to render into
|
||||
* @get_surface_dimensions: retrieve the current size of the window
|
||||
* @handle_event: set whether to handle extra window system events
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanWindowClass {
|
||||
GstObjectClass parent_class;
|
||||
|
|
|
@ -49,8 +49,6 @@ typedef struct _GstVulkanCommandPoolPrivate GstVulkanCommandPoolPrivate;
|
|||
typedef struct _GstVulkanCommandBuffer GstVulkanCommandBuffer;
|
||||
|
||||
typedef struct _GstVulkanDescriptorSet GstVulkanDescriptorSet;
|
||||
typedef struct _GstVulkanDescriptorSetClass GstVulkanDescriptorSetClass;
|
||||
typedef struct _GstVulkanDescriptorSetPrivate GstVulkanDescriptorSetPrivate;
|
||||
|
||||
typedef struct _GstVulkanDescriptorPool GstVulkanDescriptorPool;
|
||||
typedef struct _GstVulkanDescriptorPoolClass GstVulkanDescriptorPoolClass;
|
||||
|
|
|
@ -107,10 +107,12 @@ gst_vulkan_display_wayland_finalize (GObject * object)
|
|||
* gst_vulkan_display_wayland_new:
|
||||
* @name: (allow-none): a display name
|
||||
*
|
||||
* Create a new #GstVulkanDisplayWayland from the wayland display name. See wl_display_connect()
|
||||
* Create a new #GstVulkanDisplayWayland from the wayland display name. See `wl_display_connect`()
|
||||
* for details on what is a valid name.
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanDisplayWayland or %NULL
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanDisplayWayland *
|
||||
gst_vulkan_display_wayland_new (const gchar * name)
|
||||
|
@ -147,6 +149,8 @@ gst_vulkan_display_wayland_new (const gchar * name)
|
|||
* Creates a new display connection from a wl_display Display.
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanDisplayWayland
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanDisplayWayland *
|
||||
gst_vulkan_display_wayland_new_with_display (struct wl_display * display)
|
||||
|
|
|
@ -38,6 +38,11 @@ GType gst_vulkan_display_wayland_get_type (void);
|
|||
#define GST_VULKAN_DISPLAY_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_VULKAN_DISPLAY_WAYLAND,GstVulkanDisplayWaylandClass))
|
||||
#define GST_IS_VULKAN_DISPLAY_WAYLAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VULKAN_DISPLAY_WAYLAND))
|
||||
#define GST_IS_VULKAN_DISPLAY_WAYLAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_VULKAN_DISPLAY_WAYLAND))
|
||||
/**
|
||||
* GST_VULKAN_DISPLAY_WAYLAND_CAST:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_DISPLAY_WAYLAND_CAST(obj) ((GstVulkanDisplayWayland*)(obj))
|
||||
|
||||
typedef struct _GstVulkanDisplayWayland GstVulkanDisplayWayland;
|
||||
|
@ -48,6 +53,8 @@ typedef struct _GstVulkanDisplayWaylandClass GstVulkanDisplayWaylandClass;
|
|||
*
|
||||
* the contents of a #GstVulkanDisplayWayland are private and should only be accessed
|
||||
* through the provided API
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDisplayWayland
|
||||
{
|
||||
|
@ -63,11 +70,21 @@ struct _GstVulkanDisplayWayland
|
|||
gboolean foreign_display;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanDisplayWaylandClass:s
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDisplayWaylandClass
|
||||
{
|
||||
GstVulkanDisplayClass object_class;
|
||||
};
|
||||
|
||||
/**
|
||||
* GST_VULKAN_DISPLAY_WAYLAND_DISPLAY
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
#define GST_VULKAN_DISPLAY_WAYLAND_DISPLAY(display_) (GST_VULKAN_DISPLAY_WAYLAND (display_)->display)
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
|
@ -88,6 +88,8 @@ _get_screen_from_connection (xcb_connection_t * connection, int screen_no)
|
|||
* for details on what is a valid name.
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanDisplayXCB or %NULL
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanDisplayXCB *
|
||||
gst_vulkan_display_xcb_new (const gchar * name)
|
||||
|
@ -114,12 +116,15 @@ gst_vulkan_display_xcb_new (const gchar * name)
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_vulkan_display_xcb_new_with_connection:
|
||||
* @display: an existing, xcb display
|
||||
* gst_vulkan_display_xcb_new_with_connection: (skip)
|
||||
* @connection: an existing, xcb display
|
||||
* @screen_no: XCB screen number
|
||||
*
|
||||
* Creates a new display connection from a XCB Display.
|
||||
*
|
||||
* Returns: (transfer full): a new #GstVulkanDisplayXCB
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
GstVulkanDisplayXCB *
|
||||
gst_vulkan_display_xcb_new_with_connection (xcb_connection_t * connection,
|
||||
|
|
|
@ -52,6 +52,8 @@ typedef struct _GstVulkanDisplayXCBClass GstVulkanDisplayXCBClass;
|
|||
*
|
||||
* the contents of a #GstVulkanDisplayXCB are private and should only be accessed
|
||||
* through the provided API
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDisplayXCB
|
||||
{
|
||||
|
@ -65,11 +67,22 @@ struct _GstVulkanDisplayXCB
|
|||
gboolean foreign_display;
|
||||
|
||||
GSource *event_source;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
/**
|
||||
* GstVulkanDisplayXCBClass:
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
struct _GstVulkanDisplayXCBClass
|
||||
{
|
||||
GstVulkanDisplayClass object_class;
|
||||
|
||||
/* <private> */
|
||||
gpointer _reserved [GST_PADDING];
|
||||
};
|
||||
|
||||
GST_VULKAN_API
|
||||
|
|
Loading…
Reference in a new issue