Vulkan Utils

Functions

gst_vulkan_create_shader

GstVulkanHandle *
gst_vulkan_create_shader (GstVulkanDevice * device,
                          const gchar * code,
                          gsize size,
                          GError ** error)

Parameters:

device –

a GstVulkanDevice

code –

the SPIR-V shader byte code

size –

length of code. Must be a multiple of 4

error ( [out][optional]) –

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


GstVulkan.prototype.vulkan_create_shader

function GstVulkan.prototype.vulkan_create_shader(device: GstVulkan.VulkanDevice, code: String, size: Number): {
    // javascript wrapper for 'gst_vulkan_create_shader'
}

Parameters:

code (String) –

the SPIR-V shader byte code

size (Number) –

length of code. Must be a multiple of 4

Returns (GstVulkan.VulkanHandle) –

a GstVulkan.VulkanHandle for image matching the original layout and format of image or null

Since : 1.18


GstVulkan.vulkan_create_shader

@raises(GLib.GError)
def GstVulkan.vulkan_create_shader (device, code, size):
    #python wrapper for 'gst_vulkan_create_shader'

Parameters:

code (str) –

the SPIR-V shader byte code

size (int) –

length of code. Must be a multiple of 4

Returns (GstVulkan.VulkanHandle) –

a GstVulkan.VulkanHandle for image matching the original layout and format of image or None

Since : 1.18


gst_vulkan_ensure_element_data

gboolean
gst_vulkan_ensure_element_data (GstElement * element,
                                GstVulkanDisplay ** display_ptr,
                                GstVulkanInstance ** instance_ptr)

Perform the steps necessary for retrieving a GstVulkanInstance and (optionally) an GstVulkanDisplay from the surrounding elements or from the application using the GstContext mechanism.

If the contents of display_ptr or instance_ptr are not NULL, then no GstContext query is necessary and no GstVulkanInstance or GstVulkanDisplay retrieval is performed.

Parameters:

element –

a GstElement

display_ptr ( [inout][optional]) –

the resulting GstVulkanDisplay

instance_ptr ( [inout]) –

the resulting GstVulkanInstance

Returns –

whether a GstVulkanInstance exists in instance_ptr and if display_ptr is not NULL, whether a GstVulkanDisplay exists in display_ptr

Since : 1.18


GstVulkan.prototype.vulkan_ensure_element_data

function GstVulkan.prototype.vulkan_ensure_element_data(element: Gst.Element, display_ptr: GstVulkan.VulkanDisplay, instance_ptr: GstVulkan.VulkanInstance): {
    // javascript wrapper for 'gst_vulkan_ensure_element_data'
}

Perform the steps necessary for retrieving a GstVulkan.VulkanInstance and (optionally) an GstVulkan.VulkanDisplay from the surrounding elements or from the application using the Gst.Context mechanism.

If the contents of display_ptr or instance_ptr are not null, then no Gst.Context query is necessary and no GstVulkan.VulkanInstance or GstVulkan.VulkanDisplay retrieval is performed.

Parameters:

element (Gst.Element) –

a Gst.Element

display_ptr (GstVulkan.VulkanDisplay) –

the resulting GstVulkan.VulkanDisplay

instance_ptr (GstVulkan.VulkanInstance) –

the resulting GstVulkan.VulkanInstance

Returns a tuple made of:

(Number ) –

whether a GstVulkan.VulkanInstance exists in instance_ptr and if display_ptr is not null, whether a GstVulkan.VulkanDisplay exists in display_ptr

display_ptr (GstVulkan.VulkanDisplay ) –

whether a GstVulkan.VulkanInstance exists in instance_ptr and if display_ptr is not null, whether a GstVulkan.VulkanDisplay exists in display_ptr

instance_ptr (GstVulkan.VulkanInstance ) –

whether a GstVulkan.VulkanInstance exists in instance_ptr and if display_ptr is not null, whether a GstVulkan.VulkanDisplay exists in display_ptr

Since : 1.18


GstVulkan.vulkan_ensure_element_data

def GstVulkan.vulkan_ensure_element_data (element, display_ptr, instance_ptr):
    #python wrapper for 'gst_vulkan_ensure_element_data'

Perform the steps necessary for retrieving a GstVulkan.VulkanInstance and (optionally) an GstVulkan.VulkanDisplay from the surrounding elements or from the application using the Gst.Context mechanism.

If the contents of display_ptr or instance_ptr are not None, then no Gst.Context query is necessary and no GstVulkan.VulkanInstance or GstVulkan.VulkanDisplay retrieval is performed.

Parameters:

element (Gst.Element) –

a Gst.Element

display_ptr (GstVulkan.VulkanDisplay) –

the resulting GstVulkan.VulkanDisplay

instance_ptr (GstVulkan.VulkanInstance) –

the resulting GstVulkan.VulkanInstance

Returns a tuple made of:

(bool ) –

whether a GstVulkan.VulkanInstance exists in instance_ptr and if display_ptr is not None, whether a GstVulkan.VulkanDisplay exists in display_ptr

display_ptr (GstVulkan.VulkanDisplay ) –

whether a GstVulkan.VulkanInstance exists in instance_ptr and if display_ptr is not None, whether a GstVulkan.VulkanDisplay exists in display_ptr

instance_ptr (GstVulkan.VulkanInstance ) –

whether a GstVulkan.VulkanInstance exists in instance_ptr and if display_ptr is not None, whether a GstVulkan.VulkanDisplay exists in display_ptr

Since : 1.18


gst_vulkan_ensure_element_device

gboolean
gst_vulkan_ensure_element_device (GstElement * element,
                                  GstVulkanInstance * instance,
                                  GstVulkanDevice ** device_ptr,
                                  guint device_id)

Perform the steps necessary for retrieving a GstVulkanDevice from the surrounding elements or create a new device according to the device_id.

If the contents of device_ptr is not NULL, then no GstContext query is necessary and no GstVulkanDevice retrieval is performed.

Parameters:

element –

a GstElement

instance –

the GstVulkanInstance

device_ptr ( [inout][optional]) –

the resulting GstVulkanDevice

device_id –

The device number to use, 0 is default.

Returns –

whether a GstVulkanDevice exists in device_ptr

Since : 1.26


GstVulkan.prototype.vulkan_ensure_element_device

function GstVulkan.prototype.vulkan_ensure_element_device(element: Gst.Element, instance: GstVulkan.VulkanInstance, device_ptr: GstVulkan.VulkanDevice, device_id: Number): {
    // javascript wrapper for 'gst_vulkan_ensure_element_device'
}

Perform the steps necessary for retrieving a GstVulkan.VulkanDevice from the surrounding elements or create a new device according to the device_id.

If the contents of device_ptr is not null, then no Gst.Context query is necessary and no GstVulkan.VulkanDevice retrieval is performed.

Parameters:

element (Gst.Element) –

a Gst.Element

device_ptr (GstVulkan.VulkanDevice) –

the resulting GstVulkan.VulkanDevice

device_id (Number) –

The device number to use, 0 is default.

Returns a tuple made of:

(Number ) –

whether a GstVulkan.VulkanDevice exists in device_ptr

device_ptr (GstVulkan.VulkanDevice ) –

whether a GstVulkan.VulkanDevice exists in device_ptr

Since : 1.26


GstVulkan.vulkan_ensure_element_device

def GstVulkan.vulkan_ensure_element_device (element, instance, device_ptr, device_id):
    #python wrapper for 'gst_vulkan_ensure_element_device'

Perform the steps necessary for retrieving a GstVulkan.VulkanDevice from the surrounding elements or create a new device according to the device_id.

If the contents of device_ptr is not None, then no Gst.Context query is necessary and no GstVulkan.VulkanDevice retrieval is performed.

Parameters:

element (Gst.Element) –

a Gst.Element

device_ptr (GstVulkan.VulkanDevice) –

the resulting GstVulkan.VulkanDevice

device_id (int) –

The device number to use, 0 is default.

Returns a tuple made of:

(bool ) –

whether a GstVulkan.VulkanDevice exists in device_ptr

device_ptr (GstVulkan.VulkanDevice ) –

whether a GstVulkan.VulkanDevice exists in device_ptr

Since : 1.26


gst_vulkan_get_or_create_image_view

GstVulkanImageView *
gst_vulkan_get_or_create_image_view (GstVulkanImageMemory * image)

Parameters:

image –

a GstVulkanImageMemory

Returns ( [transfer: full]) –

a GstVulkanImageView for image matching the original layout and format of image

Since : 1.18


GstVulkan.prototype.vulkan_get_or_create_image_view

function GstVulkan.prototype.vulkan_get_or_create_image_view(image: GstVulkan.VulkanImageMemory): {
    // javascript wrapper for 'gst_vulkan_get_or_create_image_view'
}

a GstVulkan.VulkanImageView for image matching the original layout and format of image

Since : 1.18


GstVulkan.vulkan_get_or_create_image_view

def GstVulkan.vulkan_get_or_create_image_view (image):
    #python wrapper for 'gst_vulkan_get_or_create_image_view'

a GstVulkan.VulkanImageView for image matching the original layout and format of image

Since : 1.18


gst_vulkan_get_or_create_image_view_for_plane

GstVulkanImageView *
gst_vulkan_get_or_create_image_view_for_plane (GstBuffer * buffer,
                                               const GstVideoInfo * info,
                                               guint plane,
                                               GError ** error)

Like gst_vulkan_get_or_create_image_view, but also handles plane being packed into a single composite GstVulkanImageMemory (@buffer has one memory), by deriving a single-plane view via the plane's own format and VK_IMAGE_ASPECT_PLANE_0_BIT << plane. That requires the image to be created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; if it is missing, error is set and NULL is returned, as well as if the plane's format supports none of the image usage. The view's usage is restricted as described in gst_vulkan_get_or_create_image_view_with_info.

Any other combination (more than one but fewer memories than planes) fails, as do formats without planes (e.g. GST_VIDEO_FORMAT_DMA_DRM).

Parameters:

buffer –

a GstBuffer holding Vulkan image memories

info –

the GstVideoInfo describing buffer's video format

plane –

the video plane index to get a view for

error ( [out][optional]) –

a GError to fill on failure

Returns ( [transfer: full][nullable]) –

a GstVulkanImageView for plane, or NULL on failure

Since : 1.30


GstVulkan.prototype.vulkan_get_or_create_image_view_for_plane

function GstVulkan.prototype.vulkan_get_or_create_image_view_for_plane(buffer: Gst.Buffer, info: GstVideo.VideoInfo, plane: Number): {
    // javascript wrapper for 'gst_vulkan_get_or_create_image_view_for_plane'
}

Like GstVulkan.prototype.vulkan_get_or_create_image_view, but also handles plane being packed into a single composite GstVulkan.VulkanImageMemory (@buffer has one memory), by deriving a single-plane view via the plane's own format and VK_IMAGE_ASPECT_PLANE_0_BIT << plane. That requires the image to be created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; if it is missing, error is set and null is returned, as well as if the plane's format supports none of the image usage. The view's usage is restricted as described in GstVulkan.prototype.vulkan_get_or_create_image_view_with_info.

Any other combination (more than one but fewer memories than planes) fails, as do formats without planes (e.g. GstVideo.VideoFormat.DMA_DRM).

Parameters:

buffer (Gst.Buffer) –

a Gst.Buffer holding Vulkan image memories

info (GstVideo.VideoInfo) –

the GstVideo.VideoInfo describing buffer's video format

plane (Number) –

the video plane index to get a view for

a GstVulkan.VulkanImageView for plane, or null on failure

Since : 1.30


GstVulkan.vulkan_get_or_create_image_view_for_plane

@raises(GLib.GError)
def GstVulkan.vulkan_get_or_create_image_view_for_plane (buffer, info, plane):
    #python wrapper for 'gst_vulkan_get_or_create_image_view_for_plane'

Like GstVulkan.vulkan_get_or_create_image_view, but also handles plane being packed into a single composite GstVulkan.VulkanImageMemory (@buffer has one memory), by deriving a single-plane view via the plane's own format and VK_IMAGE_ASPECT_PLANE_0_BIT << plane. That requires the image to be created with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT; if it is missing, error is set and None is returned, as well as if the plane's format supports none of the image usage. The view's usage is restricted as described in GstVulkan.vulkan_get_or_create_image_view_with_info.

Any other combination (more than one but fewer memories than planes) fails, as do formats without planes (e.g. GstVideo.VideoFormat.DMA_DRM).

Parameters:

buffer (Gst.Buffer) –

a Gst.Buffer holding Vulkan image memories

info (GstVideo.VideoInfo) –

the GstVideo.VideoInfo describing buffer's video format

plane (int) –

the video plane index to get a view for

a GstVulkan.VulkanImageView for plane, or None on failure

Since : 1.30


gst_vulkan_get_or_create_image_view_with_info

GstVulkanImageView *
gst_vulkan_get_or_create_image_view_with_info (GstVulkanImageMemory * image,
                                               const VkImageViewCreateInfo* create_info)

Create a new GstVulkanImageView with a specific create_info.

A new view gets only the part of image's usage its format supports, unless create_info already chains a VkImageViewUsageCreateInfo (requires Vulkan 1.1 or VK_KHR_maintenance2). Existing views are reused regardless of the pNext chain.

Parameters:

image –

a GstVulkanImageMemory

create_info ( [nullable]) –

a VkImageViewCreateInfo

Returns ( [transfer: full]) –

a GstVulkanImageView for image matching the original layout and format of image

Since : 1.24


GstVulkan.prototype.vulkan_get_or_create_image_view_with_info

function GstVulkan.prototype.vulkan_get_or_create_image_view_with_info(image: GstVulkan.VulkanImageMemory, create_info: Vulkan.ImageViewCreateInfo): {
    // javascript wrapper for 'gst_vulkan_get_or_create_image_view_with_info'
}

Create a new GstVulkan.VulkanImageView with a specific create_info.

A new view gets only the part of image's usage its format supports, unless create_info already chains a VkImageViewUsageCreateInfo (requires Vulkan 1.1 or VK_KHR_maintenance2). Existing views are reused regardless of the pNext chain.

Parameters:

create_info (Vulkan.ImageViewCreateInfo) –

a VkImageViewCreateInfo

a GstVulkan.VulkanImageView for image matching the original layout and format of image

Since : 1.24


GstVulkan.vulkan_get_or_create_image_view_with_info

def GstVulkan.vulkan_get_or_create_image_view_with_info (image, create_info):
    #python wrapper for 'gst_vulkan_get_or_create_image_view_with_info'

Create a new GstVulkan.VulkanImageView with a specific create_info.

A new view gets only the part of image's usage its format supports, unless create_info already chains a VkImageViewUsageCreateInfo (requires Vulkan 1.1 or VK_KHR_maintenance2). Existing views are reused regardless of the pNext chain.

Parameters:

create_info (Vulkan.ImageViewCreateInfo) –

a VkImageViewCreateInfo

a GstVulkan.VulkanImageView for image matching the original layout and format of image

Since : 1.24


gst_vulkan_global_context_query

gst_vulkan_global_context_query (GstElement * element,
                                 const gchar * context_type)

Performs the steps necessary for executing a context query including posting a message for the application to respond.

Parameters:

element –

a GstElement

context_type –

the context type to query for

Since : 1.18


GstVulkan.prototype.vulkan_global_context_query

function GstVulkan.prototype.vulkan_global_context_query(element: Gst.Element, context_type: String): {
    // javascript wrapper for 'gst_vulkan_global_context_query'
}

Performs the steps necessary for executing a context query including posting a message for the application to respond.

Parameters:

element (Gst.Element) –

a Gst.Element

context_type (String) –

the context type to query for

Since : 1.18


GstVulkan.vulkan_global_context_query

def GstVulkan.vulkan_global_context_query (element, context_type):
    #python wrapper for 'gst_vulkan_global_context_query'

Performs the steps necessary for executing a context query including posting a message for the application to respond.

Parameters:

element (Gst.Element) –

a Gst.Element

context_type (str) –

the context type to query for

Since : 1.18


gst_vulkan_local_context_query

GstQuery *
gst_vulkan_local_context_query (GstElement * element,
                                const gchar * context_type)

Performs the steps necessary for executing a context query between only other elements in the pipeline

Parameters:

element –

a GstElement

context_type –

the context type to query for

Returns –
No description available

Since : 1.18


GstVulkan.prototype.vulkan_local_context_query

function GstVulkan.prototype.vulkan_local_context_query(element: Gst.Element, context_type: String): {
    // javascript wrapper for 'gst_vulkan_local_context_query'
}

Performs the steps necessary for executing a context query between only other elements in the pipeline

Parameters:

element (Gst.Element) –

a Gst.Element

context_type (String) –

the context type to query for

Returns (Gst.Query) –
No description available

Since : 1.18


GstVulkan.vulkan_local_context_query

def GstVulkan.vulkan_local_context_query (element, context_type):
    #python wrapper for 'gst_vulkan_local_context_query'

Performs the steps necessary for executing a context query between only other elements in the pipeline

Parameters:

element (Gst.Element) –

a Gst.Element

context_type (str) –

the context type to query for

Returns (Gst.Query) –
No description available

Since : 1.18


gst_vulkan_run_query

gboolean
gst_vulkan_run_query (GstElement * element,
                      GstQuery * query,
                      GstPadDirection direction)

Parameters:

element –

a GstElement

query –

the GstQuery to perform

direction –

the GstPadDirection to perform query on

Returns –

whether query was answered successfully

Since : 1.18


GstVulkan.prototype.vulkan_run_query

function GstVulkan.prototype.vulkan_run_query(element: Gst.Element, query: Gst.Query, direction: Gst.PadDirection): {
    // javascript wrapper for 'gst_vulkan_run_query'
}

Parameters:

element (Gst.Element) –

a Gst.Element

query (Gst.Query) –

the Gst.Query to perform

direction (Gst.PadDirection) –

the Gst.PadDirection to perform query on

Returns (Number) –

whether query was answered successfully

Since : 1.18


GstVulkan.vulkan_run_query

def GstVulkan.vulkan_run_query (element, query, direction):
    #python wrapper for 'gst_vulkan_run_query'

Parameters:

element (Gst.Element) –

a Gst.Element

query (Gst.Query) –

the Gst.Query to perform

direction (Gst.PadDirection) –

the Gst.PadDirection to perform query on

Returns (bool) –

whether query was answered successfully

Since : 1.18


The results of the search are