GstVulkan.VulkanInstance

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GstVulkan.VulkanInstance GstVulkan.VulkanInstance Gst.Object->GstVulkan.VulkanInstance

Subclasses:

None

Methods

Inherited:

Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

handle_context_query (element, query, instance)

class

new ()

class

run_context_query (element, instance)

check_api_version (major, minor, patch)

check_version (major, minor, patch)

create_device ()

create_device_with_index (device_index)

disable_extension (name)

enable_extension (name)

enable_layer (name)

fill_info ()

get_api_version ()

get_extension_info (name)

get_layer_info (name)

get_proc_address (name)

get_version ()

is_extension_enabled (name)

is_layer_enabled (name)

open ()

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7)

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

requested-api-major

int

r/w

Major version of the requested Vulkan API (0 = maximum supported)

requested-api-minor

int

r/w

Minor version of the requested Vulkan API

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Short Description

create-device

Overrides the GstVulkan.VulkanDevice creation mechanism.

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

instance

Vulkan.Instance

r

the Vulkan instance handle

n_physical_devices

int

r

parent

Gst.Object

r

parent Gst.Object

physical_devices

Vulkan.PhysicalDevice

r

list of vulkan physical device handles

Class Details

class GstVulkan.VulkanInstance(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstVulkan.VulkanInstanceClass

New in version 1.18.

classmethod handle_context_query(element, query, instance)
Parameters:
Returns:

whether query was responded to with instance

Return type:

bool

If a GstVulkan.VulkanInstance is requested in query, sets instance as the reply.

Intended for use with element query handlers to respond to Gst.QueryType.CONTEXT for a GstVulkan.VulkanInstance.

New in version 1.18.

classmethod new()
Returns:

a new uninitialized GstVulkan.VulkanInstance

Return type:

GstVulkan.VulkanInstance

New in version 1.18.

classmethod run_context_query(element, instance)
Parameters:
Returns:

whether instance contains a valid GstVulkan.VulkanInstance

instance:

a GstVulkan.VulkanInstance

Return type:

(bool, instance: GstVulkan.VulkanInstance)

Attempt to retrieve a GstVulkan.VulkanInstance using Gst.QueryType.CONTEXT from the surrounding elements of element.

New in version 1.18.

check_api_version(major, minor, patch)
Parameters:
  • major (int) – the API major version to check

  • minor (int) – the API minor version to check

  • patch (int) – the API patch version to check

Returns:

whether the GstVulkan.VulkanInstance supports the version specified by major, minor and patch.

Return type:

bool

New in version 1.26.

check_version(major, minor, patch)
Parameters:
  • major (int) – major version

  • minor (int) – minor version

  • patch (int) – patch version

Returns:

whether self is at least the requested version.

Return type:

bool

Check if the configured vulkan instance supports the specified version. Will not work prior to opening the instance with GstVulkan.VulkanInstance.open(). If a specific version is requested, the patch level is ignored.

New in version 1.18.

create_device()
Raises:

GLib.Error

Returns:

a new GstVulkan.VulkanDevice

Return type:

GstVulkan.VulkanDevice

New in version 1.18.

create_device_with_index(device_index)
Parameters:

device_index (int) – the device index to create the new GstVulkan.VulkanDevice from

Raises:

GLib.Error

Returns:

a new GstVulkan.VulkanDevice

Return type:

GstVulkan.VulkanDevice

New in version 1.26.

disable_extension(name)
Parameters:

name (str) – extension name to enable

Returns:

whether the Vulkan extension could be disabled.

Return type:

bool

Disable an Vulkan extension by name. Disabling an extension will only have an effect before the call to GstVulkan.VulkanInstance.open().

New in version 1.18.

enable_extension(name)
Parameters:

name (str) – extension name to enable

Returns:

whether the Vulkan extension could be enabled.

Return type:

bool

Enable an Vulkan extension by name. Extensions cannot be enabled until GstVulkan.VulkanInstance.fill_info() has been called. Enabling an extension will only have an effect before the call to GstVulkan.VulkanInstance.open().

New in version 1.18.

enable_layer(name)
Parameters:

name (str) – layer name to enable

Returns:

whether the Vulkan layer could be enabled.

Return type:

bool

Enable an Vulkan layer by name. Layer cannot be enabled until GstVulkan.VulkanInstance.fill_info() has been called. Enabling a layer will only have an effect before the call to GstVulkan.VulkanInstance.open().

New in version 1.18.

fill_info()
Raises:

GLib.Error

Returns:

whether the instance information could be retrieved

Return type:

bool

Retrieve as much information about the available Vulkan instance without actually creating an Vulkan instance. Will not do anything while self is open.

New in version 1.18.

get_api_version()
Returns:

major:

major version

minor:

minor version

patch:

patch version

Return type:

(major: int, minor: int, patch: int)

Returns the vulkan API version configured when constructing the GstVulkan.VulkanInstance. This value can be any valid Vulkan API version and may not match GstVulkan.VulkanInstance.get_version() in any way. This version is the maximum allowed vulkan API to be used in any capacity.

This will not return valid values until GstVulkan.VulkanInstance.open() has been called.

New in version 1.26.

get_extension_info(name)
Parameters:

name (str) – the layer name to look for

Returns:

whether extension name is available

spec_version:

return value for the layer specification version

Return type:

(bool, spec_version: int)

Retrieves information about an extension.

Will not find any extensions before GstVulkan.VulkanInstance.fill_info() has been called.

New in version 1.18.

get_layer_info(name)
Parameters:

name (str) – the layer name to look for

Returns:

whether layer name is available

description:

return value for the layer description or None

spec_version:

return value for the layer specification version

implementation_version:

return value for the layer implementation version

Return type:

(bool, description: str or None, spec_version: int, implementation_version: int)

Retrieves information about a layer.

Will not find any layers before GstVulkan.VulkanInstance.fill_info() has been called.

New in version 1.18.

get_proc_address(name)
Parameters:

name (str) – name of the function to retrieve

Returns:

the function pointer for name or None

Return type:

object or None

Performs vkGetInstanceProcAddr() with self and name

New in version 1.18.

get_version()
Returns:

major:

major version

minor:

minor version

patch:

patch version

Return type:

(major: int, minor: int, patch: int)

Retrieve the vulkan instance supported version. Only returns the supported API version by the instance without taking into account the requested API version. This means GstVulkan.VulkanInstance.check_version() will return different values if a specific version has been requested (which is the default) than a version check that is performed manually by retrieving the version with this function.

New in version 1.18.

is_extension_enabled(name)
Parameters:

name (str) – extension name

Returns:

whether extension name is enabled

Return type:

bool

New in version 1.18.

is_layer_enabled(name)
Parameters:

name (str) – layer name

Returns:

whether layer name is enabled

Return type:

bool

New in version 1.18.

open()
Raises:

GLib.Error

Returns:

whether the instance could be created

Return type:

bool

New in version 1.18.

Signal Details

GstVulkan.VulkanInstance.signals.create_device(vulkan_instance, device_index)
Signal Name:

create-device

Flags:

RUN_LAST

Parameters:
Returns:

the newly created GstVulkan.VulkanDevice.

Return type:

GstVulkan.VulkanDevice

Overrides the GstVulkan.VulkanDevice creation mechanism. It can be called from any thread.

New in version 1.26.

Property Details

GstVulkan.VulkanInstance.props.requested_api_major
Name:

requested-api-major

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Major version of the requested Vulkan API (0 = maximum supported)

New in version 1.18.

GstVulkan.VulkanInstance.props.requested_api_minor
Name:

requested-api-minor

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Minor version of the requested Vulkan API

New in version 1.18.