Functions¶
Details¶
- GstVulkan.context_get_vulkan_device(context, device)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
device (
GstVulkan.VulkanDevice
) – resultingGstVulkan.VulkanDevice
- Returns:
Whether device was in context
- Return type:
New in version 1.18.
- GstVulkan.context_get_vulkan_display(context, display)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
display (
GstVulkan.VulkanDisplay
) – resultingGstVulkan.VulkanDisplay
- Returns:
Whether display was in context
- Return type:
New in version 1.18.
- GstVulkan.context_get_vulkan_instance(context, instance)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
instance (
GstVulkan.VulkanInstance
) – resultingGstVulkan.VulkanInstance
- Returns:
Whether instance was in context
- Return type:
New in version 1.18.
- GstVulkan.context_get_vulkan_queue(context, queue)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
queue (
GstVulkan.VulkanQueue
) – resultingGstVulkan.VulkanQueue
- Returns:
Whether queue was in context
- Return type:
New in version 1.18.
- GstVulkan.context_set_vulkan_device(context, device)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
Sets device on context
New in version 1.18.
- GstVulkan.context_set_vulkan_display(context, display)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
display (
GstVulkan.VulkanDisplay
) – aGstVulkan.VulkanDisplay
Sets display on context
New in version 1.18.
- GstVulkan.context_set_vulkan_instance(context, instance)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
instance (
GstVulkan.VulkanInstance
) – aGstVulkan.VulkanInstance
Sets instance on context
New in version 1.18.
- GstVulkan.context_set_vulkan_queue(context, queue)¶
- Parameters:
context (
Gst.Context
) – aGst.Context
queue (
GstVulkan.VulkanQueue
) – aGstVulkan.VulkanQueue
Sets queue on context
New in version 1.18.
- GstVulkan.is_vulkan_buffer_memory(mem)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
- Returns:
whether the memory at mem is a
GstVulkan.VulkanBufferMemory
- Return type:
New in version 1.18.
- GstVulkan.is_vulkan_image_memory(mem)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
- Returns:
whether the memory at mem is a
GstVulkan.VulkanImageMemory
- Return type:
New in version 1.18.
- GstVulkan.is_vulkan_memory(mem)¶
- Parameters:
mem (
Gst.Memory
) – aGst.Memory
- Returns:
whether the memory at mem is a
GstVulkan.VulkanMemory
- Return type:
New in version 1.18.
- GstVulkan.vulkan_buffer_memory_alloc(device, size, usage, mem_prop_flags)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
size (
int
) – size of the new bufferusage (
Vulkan.BufferUsageFlags
) – buffer usage flagsmem_prop_flags (
Vulkan.MemoryPropertyFlags
) – memory properties flags for the backing memory
- Returns:
a
Gst.Memory
object backed by a vulkan buffer backed by vulkan device memory- Return type:
Allocate a new
GstVulkan.VulkanBufferMemory
.New in version 1.18.
- GstVulkan.vulkan_buffer_memory_alloc_with_buffer_info(device, buffer_info, mem_prop_flags)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
buffer_info (
Vulkan.BufferCreateInfo
) – theVulkan.BufferCreateInfo
structuremem_prop_flags (
Vulkan.MemoryPropertyFlags
) – memory properties flags for the backing memory
- Returns:
a
Gst.Memory
object backed by a vulkan buffer backed by vulkan device memory- Return type:
Allocate a new
GstVulkan.VulkanBufferMemory
.New in version 1.24.
- GstVulkan.vulkan_buffer_memory_init_once()¶
Initializes the Vulkan buffer memory allocator. It is safe to call this function multiple times. This must be called before any other
GstVulkan.VulkanBufferMemory
operation.New in version 1.18.
- GstVulkan.vulkan_buffer_memory_wrapped(device, buffer, usage, user_data, notify)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
buffer (
Vulkan.Buffer
) – aVkBuffer
usage (
Vulkan.BufferUsageFlags
) – usage flags of buffernotify (
GLib.DestroyNotify
orNone
) – aGLib.DestroyNotify
called when buffer is no longer in use
- Returns:
a
Gst.Memory
object backed by a vulkan device memory- Return type:
Allocated a new wrapped
GstVulkan.VulkanBufferMemory
with buffer.New in version 1.18.
- GstVulkan.vulkan_create_shader(device, code, size)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
code (
str
) – the SPIR-V shader byte codesize (
int
) – length of code. Must be a multiple of 4
- Raises:
- Returns:
a
GstVulkan.VulkanHandle
for image matching the original layout and format of image orNone
- Return type:
New in version 1.18.
- GstVulkan.vulkan_display_type_to_extension_string(type)¶
- Parameters:
type (
GstVulkan.VulkanDisplayType
) – aGstVulkan.VulkanDisplayType
- Returns:
the Vulkan extension string required for creating a
Vulkan.SurfaceKHR
using a window system handle orNone
- Return type:
New in version 1.18.
- GstVulkan.vulkan_ensure_element_data(element, display_ptr, instance_ptr)¶
- Parameters:
element (
Gst.Element
) – aGst.Element
display_ptr (
GstVulkan.VulkanDisplay
) – the resultingGstVulkan.VulkanDisplay
instance_ptr (
GstVulkan.VulkanInstance
) – the resultingGstVulkan.VulkanInstance
- Returns:
whether a
GstVulkan.VulkanInstance
exists in instance_ptr and if display_ptr is notNone
, whether aGstVulkan.VulkanDisplay
exists in display_ptr- display_ptr:
the resulting
GstVulkan.VulkanDisplay
- instance_ptr:
the resulting
GstVulkan.VulkanInstance
- Return type:
(
bool
, display_ptr:GstVulkan.VulkanDisplay
, instance_ptr:GstVulkan.VulkanInstance
)
Perform the steps necessary for retrieving a
GstVulkan.VulkanInstance
and (optionally) anGstVulkan.VulkanDisplay
from the surrounding elements or from the application using theGst.Context
mechanism.If the contents of display_ptr or instance_ptr are not
None
, then noGst.Context
query is necessary and noGstVulkan.VulkanInstance
orGstVulkan.VulkanDisplay
retrieval is performed.New in version 1.18.
- GstVulkan.vulkan_format_get_aspect(format)¶
- Parameters:
format (
Vulkan.Format
) – Vulkan Format- Returns:
the format aspect
- Return type:
New in version 1.24.
- GstVulkan.vulkan_format_get_info(format)¶
- Parameters:
format (
Vulkan.Format
) – a validVkFormat
- Returns:
the
GstVulkan.VulkanFormatInfo
for format orNone
- Return type:
New in version 1.18.
- GstVulkan.vulkan_format_to_video_format(vk_format)¶
- Parameters:
vk_format (
Vulkan.Format
) – the Vulkan format to convert- Returns:
the
GstVideo.VideoFormat
that maps to vk_format- Return type:
New in version 1.24.
- GstVulkan.vulkan_get_or_create_image_view(image)¶
- Parameters:
image (
GstVulkan.VulkanImageMemory
) – aGstVulkan.VulkanImageMemory
- Returns:
a
GstVulkan.VulkanImageView
for image matching the original layout and format of image- Return type:
New in version 1.18.
- GstVulkan.vulkan_get_or_create_image_view_with_info(image, create_info)¶
- Parameters:
image (
GstVulkan.VulkanImageMemory
) – aGstVulkan.VulkanImageMemory
create_info (
Vulkan.ImageViewCreateInfo
orNone
) – aVulkan.ImageViewCreateInfo
- Returns:
a
GstVulkan.VulkanImageView
for image matching the original layout and format of image- Return type:
Create a new
GstVulkan.VulkanImageView
with a specific create_info.New in version 1.24.
- GstVulkan.vulkan_global_context_query(element, context_type)¶
- Parameters:
element (
Gst.Element
) – aGst.Element
context_type (
str
) – the context type to query for
Performs the steps necessary for executing a context query including posting a message for the application to respond.
New in version 1.18.
- GstVulkan.vulkan_handle_context_query(element, query, display, instance, device)¶
- Parameters:
element (
Gst.Element
) – aGst.Element
query (
Gst.Query
) – aGst.Query
of typeGst.QueryType.CONTEXT
display (
GstVulkan.VulkanDisplay
orNone
) – aGstVulkan.VulkanDisplay
instance (
GstVulkan.VulkanInstance
orNone
) – aGstVulkan.VulkanInstance
device (
GstVulkan.VulkanDevice
orNone
) – aGstVulkan.VulkanInstance
- Returns:
Whether the query was successfully responded to from the passed display, instance, and device.
- Return type:
New in version 1.18.
- GstVulkan.vulkan_handle_set_context(element, context, display, instance)¶
- Parameters:
element (
Gst.Element
) – aGst.Element
context (
Gst.Context
) – aGst.Context
display (
GstVulkan.VulkanDisplay
) – location of aGstVulkan.VulkanDisplay
instance (
GstVulkan.VulkanInstance
) – location of aGstVulkan.VulkanInstance
- Returns:
whether the display or instance could be set successfully
- display:
location of a
GstVulkan.VulkanDisplay
- instance:
location of a
GstVulkan.VulkanInstance
- Return type:
(
bool
, display:GstVulkan.VulkanDisplay
, instance:GstVulkan.VulkanInstance
)
Helper function for implementing
Gst.Element.do_set_context
() in Vulkan capable elements.Retrieve’s the
GstVulkan.VulkanDisplay
orGstVulkan.VulkanInstance
in context and places the result in display or instance respectively.New in version 1.18.
- GstVulkan.vulkan_image_memory_alloc(device, format, width, height, tiling, usage, mem_prop_flags)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
format (
Vulkan.Format
) – theVulkan.Format
for the new imagewidth (
int
) – width for the new imageheight (
int
) – height for the new imagetiling (
Vulkan.ImageTiling
) – tiling for the new imageusage (
Vulkan.ImageUsageFlags
) – usage flags for the new imagemem_prop_flags (
Vulkan.MemoryPropertyFlags
) –Vulkan.DeviceMemory
property flags for the new image
- Returns:
a
Gst.Memory
object backed by a vulkan device memory- Return type:
Allocated a new
GstVulkan.VulkanImageMemory
.New in version 1.18.
- GstVulkan.vulkan_image_memory_alloc_with_image_info(device, image_info, mem_prop_flags)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
image_info (
Vulkan.ImageCreateInfo
) –Vulkan.ImageCreateInfo
structuremem_prop_flags (
Vulkan.MemoryPropertyFlags
) –Vulkan.MemoryPropertyFlags
flags
- Returns:
a
Gst.Memory
object backed by a vulkan device memory- Return type:
New in version 1.24.
- GstVulkan.vulkan_image_memory_init_once()¶
Initializes the Vulkan image memory allocator. It is safe to call this function multiple times. This must be called before any other
GstVulkan.VulkanImageMemory
operation.New in version 1.18.
- GstVulkan.vulkan_image_memory_wrapped(device, image, format, width, height, tiling, usage, user_data, notify)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
image (
Vulkan.Image
) – aVulkan.Image
format (
Vulkan.Format
) – theVulkan.Format
for imagewidth (
int
) – width of imageheight (
int
) – height of imagetiling (
Vulkan.ImageTiling
) – tiling of imageusage (
Vulkan.ImageUsageFlags
) – usage flags of imagenotify (
GLib.DestroyNotify
) – aGLib.DestroyNotify
when image is no longer needed
- Returns:
a new
GstVulkan.VulkanImageMemory
wrapping image- Return type:
New in version 1.18.
- GstVulkan.vulkan_local_context_query(element, context_type)¶
- Parameters:
element (
Gst.Element
) – aGst.Element
context_type (
str
) – the context type to query for
- Return type:
Performs the steps necessary for executing a context query between only other elements in the pipeline
New in version 1.18.
- GstVulkan.vulkan_memory_alloc(device, memory_type_index, params, size, mem_prop_flags)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
memory_type_index (
int
) – the Vulkan memory type indexparams (
Gst.AllocationParams
) – aGst.AllocationParams
size (
int
) – the size to allocatemem_prop_flags (
Vulkan.MemoryPropertyFlags
) –
- Returns:
a
Gst.Memory
object backed by a vulkan device memory- Return type:
Allocated a new
GstVulkan.VulkanMemory
.New in version 1.18.
- GstVulkan.vulkan_memory_find_memory_type_index_with_requirements(device, req, properties)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – aGstVulkan.VulkanDevice
req (
Vulkan.MemoryRequirements
) – memory requirements to look forproperties (
Vulkan.MemoryPropertyFlags
) – memory properties to search for
- Returns:
whether a valid memory type could be found
- type_index:
resulting index of the memory type
- Return type:
New in version 1.24.
- GstVulkan.vulkan_memory_heap_flags_to_string(prop_bits)¶
- Parameters:
prop_bits (
Vulkan.MemoryHeapFlags
) –- Return type:
New in version 1.18.
- GstVulkan.vulkan_memory_init_once()¶
Initializes the Vulkan memory allocator. It is safe to call this function multiple times. This must be called before any other
GstVulkan.VulkanMemory
operation.New in version 1.18.
- GstVulkan.vulkan_memory_property_flags_to_string(prop_bits)¶
- Parameters:
prop_bits (
Vulkan.MemoryPropertyFlags
) –- Return type:
New in version 1.18.
- GstVulkan.vulkan_present_mode_to_string(present_mode)¶
- Parameters:
present_mode (
Vulkan.PresentModeKHR
) – aVkPresentModeKHR
- Returns:
name of present_mode
- Return type:
New in version 1.20.
- GstVulkan.vulkan_run_query(element, query, direction)¶
- Parameters:
element (
Gst.Element
) – aGst.Element
direction (
Gst.PadDirection
) – theGst.PadDirection
to perform query on
- Returns:
whether query was answered successfully
- Return type:
New in version 1.18.
- GstVulkan.vulkan_sample_count_flags_to_string(sample_count_bits)¶
- Parameters:
sample_count_bits (
Vulkan.SampleCountFlags
) –- Return type:
New in version 1.18.
- GstVulkan.vulkan_trash_mini_object_unref(device, user_data)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – theGstVulkan.VulkanDevice
user_data (
object
orNone
) – theGst.MiniObject
A
GstVulkan.VulkanTrashNotify
implementation for unreffing aGst.MiniObject
when the associatedGstVulkan.VulkanFence
is signalledNew in version 1.18.
- GstVulkan.vulkan_trash_object_unref(device, user_data)¶
- Parameters:
device (
GstVulkan.VulkanDevice
) – theGstVulkan.VulkanDevice
user_data (
object
orNone
) – theGst.MiniObject
A
GstVulkan.VulkanTrashNotify
implementation for unreffing aGst.Object
when the associatedGstVulkan.VulkanFence
is signalledNew in version 1.18.