Functions¶
Details¶
- GstVulkan.context_get_vulkan_device(context)¶
- Parameters:
context (
Gst.Context) – aGst.Context- Returns:
Whether device was in context
- device:
resulting
GstVulkan.VulkanDevice
- Return type:
(
bool, device:GstVulkan.VulkanDeviceorNone)
New in version 1.18.
- GstVulkan.context_get_vulkan_display(context)¶
- Parameters:
context (
Gst.Context) – aGst.Context- Returns:
Whether display was in context
- display:
resulting
GstVulkan.VulkanDisplay
- Return type:
(
bool, display:GstVulkan.VulkanDisplayorNone)
New in version 1.18.
- GstVulkan.context_get_vulkan_instance(context)¶
- Parameters:
context (
Gst.Context) – aGst.Context- Returns:
Whether instance was in context
- instance:
resulting
GstVulkan.VulkanInstance
- Return type:
(
bool, instance:GstVulkan.VulkanInstanceorNone)
New in version 1.18.
- GstVulkan.context_get_vulkan_queue(context)¶
- Parameters:
context (
Gst.Context) – aGst.Context- Returns:
Whether queue was in context
- queue:
resulting
GstVulkan.VulkanQueue
- Return type:
(
bool, queue:GstVulkan.VulkanQueueorNone)
New in version 1.18.
- GstVulkan.context_set_vulkan_device(context, device)¶
- Parameters:
context (
Gst.Context) – aGst.Contextdevice (
GstVulkan.VulkanDeviceorNone) – aGstVulkan.VulkanDevice
Sets device on context
New in version 1.18.
- GstVulkan.context_set_vulkan_display(context, display)¶
- Parameters:
context (
Gst.Context) – aGst.Contextdisplay (
GstVulkan.VulkanDisplayorNone) – aGstVulkan.VulkanDisplay
Sets display on context
New in version 1.18.
- GstVulkan.context_set_vulkan_instance(context, instance)¶
- Parameters:
context (
Gst.Context) – aGst.Contextinstance (
GstVulkan.VulkanInstanceorNone) – aGstVulkan.VulkanInstance
Sets instance on context
New in version 1.18.
- GstVulkan.context_set_vulkan_queue(context, queue)¶
- Parameters:
context (
Gst.Context) – aGst.Contextqueue (
GstVulkan.VulkanQueueorNone) – 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.VulkanDevicesize (
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.Memoryobject 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.VulkanDevicebuffer_info (
Vulkan.BufferCreateInfo) – theVulkan.BufferCreateInfostructuremem_prop_flags (
Vulkan.MemoryPropertyFlags) – memory properties flags for the backing memory
- Returns:
a
Gst.Memoryobject 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.VulkanBufferMemoryoperation.New in version 1.18.
- GstVulkan.vulkan_buffer_memory_wrapped(device, buffer, usage, user_data, notify)¶
- Parameters:
device (
GstVulkan.VulkanDevice) – aGstVulkan.VulkanDevicebuffer (
Vulkan.Buffer) – aVkBufferusage (
Vulkan.BufferUsageFlags) – usage flags of buffernotify (
GLib.DestroyNotifyorNone) – aGLib.DestroyNotifycalled when buffer is no longer in use
- Returns:
a
Gst.Memoryobject backed by a vulkan device memory- Return type:
Allocated a new wrapped
GstVulkan.VulkanBufferMemorywith buffer.New in version 1.18.
- GstVulkan.vulkan_create_shader(device, code, size)¶
- Parameters:
device (
GstVulkan.VulkanDevice) – aGstVulkan.VulkanDevicecode (
str) – the SPIR-V shader byte codesize (
int) – length of code. Must be a multiple of 4
- Raises:
- Returns:
a
GstVulkan.VulkanHandlefor 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.SurfaceKHRusing 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.Elementdisplay_ptr (
GstVulkan.VulkanDisplay) – the resultingGstVulkan.VulkanDisplayinstance_ptr (
GstVulkan.VulkanInstance) – the resultingGstVulkan.VulkanInstance
- Returns:
whether a
GstVulkan.VulkanInstanceexists in instance_ptr and if display_ptr is notNone, whether aGstVulkan.VulkanDisplayexists 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.VulkanInstanceand (optionally) anGstVulkan.VulkanDisplayfrom the surrounding elements or from the application using theGst.Contextmechanism.If the contents of display_ptr or instance_ptr are not
None, then noGst.Contextquery is necessary and noGstVulkan.VulkanInstanceorGstVulkan.VulkanDisplayretrieval is performed.New in version 1.18.
- GstVulkan.vulkan_ensure_element_device(element, instance, device_ptr, device_id)¶
- Parameters:
element (
Gst.Element) – aGst.Elementinstance (
GstVulkan.VulkanInstance) – theGstVulkan.VulkanInstancedevice_ptr (
GstVulkan.VulkanDevice) – the resultingGstVulkan.VulkanDevicedevice_id (
int) – The device number to use, 0 is default.
- Returns:
whether a
GstVulkan.VulkanDeviceexists in device_ptr- device_ptr:
the resulting
GstVulkan.VulkanDevice
- Return type:
(
bool, device_ptr:GstVulkan.VulkanDevice)
Perform the steps necessary for retrieving a
GstVulkan.VulkanDevicefrom the surrounding elements or create a new device according to the device_id.If the contents of device_ptr is not
None, then noGst.Contextquery is necessary and noGstVulkan.VulkanDeviceretrieval is performed.New in version 1.26.
- 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.VulkanFormatInfofor 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.VideoFormatthat 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.VulkanImageViewfor 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.VulkanImageMemorycreate_info (
Vulkan.ImageViewCreateInfoorNone) – aVulkan.ImageViewCreateInfo
- Returns:
a
GstVulkan.VulkanImageViewfor image matching the original layout and format of image- Return type:
Create a new
GstVulkan.VulkanImageViewwith a specific create_info.New in version 1.24.
- GstVulkan.vulkan_global_context_query(element, context_type)¶
- Parameters:
element (
Gst.Element) – aGst.Elementcontext_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.Elementquery (
Gst.Query) – aGst.Queryof typeGst.QueryType.CONTEXTdisplay (
GstVulkan.VulkanDisplayorNone) – aGstVulkan.VulkanDisplayinstance (
GstVulkan.VulkanInstanceorNone) – aGstVulkan.VulkanInstancedevice (
GstVulkan.VulkanDeviceorNone) – aGstVulkan.VulkanDevice
- 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.Elementcontext (
Gst.Context) – aGst.Contextdisplay (
GstVulkan.VulkanDisplay) – location of aGstVulkan.VulkanDisplayinstance (
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.VulkanDisplayorGstVulkan.VulkanInstancein 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.VulkanDeviceformat (
Vulkan.Format) – theVulkan.Formatfor 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.DeviceMemoryproperty flags for the new image
- Returns:
a
Gst.Memoryobject 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.VulkanDeviceimage_info (
Vulkan.ImageCreateInfo) –Vulkan.ImageCreateInfostructuremem_prop_flags (
Vulkan.MemoryPropertyFlags) –Vulkan.MemoryPropertyFlagsflags
- Returns:
a
Gst.Memoryobject 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.VulkanImageMemoryoperation.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.VulkanDeviceimage (
Vulkan.Image) – aVulkan.Imageformat (
Vulkan.Format) – theVulkan.Formatfor imagewidth (
int) – width of imageheight (
int) – height of imagetiling (
Vulkan.ImageTiling) – tiling of imageusage (
Vulkan.ImageUsageFlags) – usage flags of imagenotify (
GLib.DestroyNotify) – aGLib.DestroyNotifywhen image is no longer needed
- Returns:
a new
GstVulkan.VulkanImageMemorywrapping image- Return type:
New in version 1.18.
- GstVulkan.vulkan_local_context_query(element, context_type)¶
- Parameters:
element (
Gst.Element) – aGst.Elementcontext_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.VulkanDevicememory_type_index (
int) – the Vulkan memory type indexparams (
Gst.AllocationParams) – aGst.AllocationParamssize (
int) – the size to allocatemem_prop_flags (
Vulkan.MemoryPropertyFlags) –
- Returns:
a
Gst.Memoryobject 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.VulkanDevicereq (
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.VulkanMemoryoperation.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.Elementdirection (
Gst.PadDirection) – theGst.PadDirectionto 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.VulkanDeviceuser_data (
objectorNone) – theGst.MiniObject
A
GstVulkan.VulkanTrashNotifyimplementation for unreffing aGst.MiniObjectwhen the associatedGstVulkan.VulkanFenceis signalledNew in version 1.18.
- GstVulkan.vulkan_trash_object_unref(device, user_data)¶
- Parameters:
device (
GstVulkan.VulkanDevice) – theGstVulkan.VulkanDeviceuser_data (
objectorNone) – theGst.MiniObject
A
GstVulkan.VulkanTrashNotifyimplementation for unreffing aGst.Objectwhen the associatedGstVulkan.VulkanFenceis signalledNew in version 1.18.