# 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:

`device` (GstVulkan.VulkanDevice) –

a GstVulkan.VulkanDevice

`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:

`device` (GstVulkan.VulkanDevice) –

a GstVulkan.VulkanDevice

`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 NULL

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 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:

(bool ) –

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

### 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'
    }

Parameters:

`image` (GstVulkan.VulkanImageMemory) –

a GstVulkan.VulkanImageMemory

Returns (GstVulkan.VulkanImageView) –

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'

Parameters:

`image` (GstVulkan.VulkanImageMemory) –

a GstVulkan.VulkanImageMemory

Returns (GstVulkan.VulkanImageView) –

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

Since : 1.18

### gst_vulkan_get_or_create_image_view_with_info

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

Create a new GstVulkanImageView with a specific create_info.

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.

Parameters:

`image` (GstVulkan.VulkanImageMemory) –

a GstVulkan.VulkanImageMemory

`create_info` (Vulkan.ImageViewCreateInfo) –

a VkImageViewCreateInfo

Returns (GstVulkan.VulkanImageView) –

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.

Parameters:

`image` (GstVulkan.VulkanImageMemory) –

a GstVulkan.VulkanImageMemory

`create_info` (Vulkan.ImageViewCreateInfo) –

a VkImageViewCreateInfo

Returns (GstVulkan.VulkanImageView) –

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