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_version (major, minor, patch)

create_device ()

disable_extension (name)

enable_extension (name)

enable_layer (name)

fill_info ()

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_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.

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_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 configured 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)
Signal Name:

create-device

Flags:

RUN_LAST

Parameters:

vulkan_instance (GstVulkan.VulkanInstance) – The object which received the signal

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.18.

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.