GstVulkan.VulkanOperation

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new (cmd_pool)

add_dependency_frame (frame, wait_stage, signal_stage)

add_frame_barrier (frame, dst_stage, new_access, new_layout, new_queue)

begin ()

begin_query (id)

discard_dependencies ()

enable_query (query_type, n_queries, pnext)

end ()

end_query (id)

get_query ()

pipeline_barrier2 (dependency_info)

reset ()

update_frame (frame, dst_stage, new_access, new_layout, new_queue)

use_sync2 ()

wait ()

Virtual Methods

Inherited:

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

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

command-pool

GstVulkan.VulkanCommandPool

r/w/co

Vulkan Command Pool

Signals

Inherited:

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

Fields

Inherited:

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

Name

Type

Access

Description

cmd_buf

GstVulkan.VulkanCommandBuffer

r

the current GstVulkan.VulkanCommandBuffer

parent

Gst.Object

r

the parent Gst.Object

Class Details

class GstVulkan.VulkanOperation(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstVulkan.VulkanOperationClass

When using the operation cmd_buf, you should lock it using gst_vulkan_command_buffer_lock(), but you have to unlock it, with gst_vulkan_command_buffer_unlock(), when calling any of GstVulkan.VulkanOperation methods.

New in version 1.24.

classmethod new(cmd_pool)
Parameters:

cmd_pool (GstVulkan.VulkanCommandPool) – a GstVulkan.VulkanCommandPool

Returns:

a newly allocated GstVulkan.VulkanOperation

Return type:

GstVulkan.VulkanOperation

add_dependency_frame(frame, wait_stage, signal_stage)
Parameters:
Returns:

whether the frame was added as dependency.

Return type:

bool

Add frame as an operation dependency by adding the timeline semaphores in each memory of frame into either the wait semaphore array. The signal array hold the same semaphores but increasing their current value.

add_frame_barrier(frame, dst_stage, new_access, new_layout, new_queue)
Parameters:
Returns:

whether the frame barriers were appended

Return type:

bool

See also: GstVulkan.VulkanOperation.update_frame()

Adds an image memory barrier per memory in frame with its future state. And it updates the frame barrier state by calling internally GstVulkan.VulkanOperation.update_frame().

begin()
Raises:

GLib.Error

Returns:

whether the operation started. It might fill error.

Return type:

bool

See also: GstVulkan.VulkanOperation.end() and GstVulkan.VulkanOperation.reset()

Attempts to set the operation ready to work. It instantiates the common command buffer in self and calls vkBeginCommandBuffer.

After calling this function you can register commands in the command buffer, and finally call GstVulkan.VulkanOperation.end(). GstVulkan.VulkanOperation.reset() is called internally if something failed.

begin_query(id)
Parameters:

id (int) –

Returns:

whether the begin command was set

Return type:

bool

Begins a query operation in the current command buffer.

discard_dependencies()

Discards barriers, and all the semaphore arrays populated by GstVulkan.VulkanOperation.add_dependency_frame().

enable_query(query_type, n_queries, pnext)
Parameters:
  • query_type (int) – the Vulkan.QueryType to enable

  • n_queries (int) – number of queries to enable

  • pnext (object or None) – the structure pointer to use as pNext

Raises:

GLib.Error

Returns:

whether the query pool was enabled. It might populate error in case of error.

Return type:

bool

Tries to enable the query pool for the current operation.

New in version 1.24.

end()
Raises:

GLib.Error

Returns:

whether the operation failed. It might fill error.

Return type:

bool

See also: GstVulkan.VulkanOperation.begin() and GstVulkan.VulkanOperation.reset()

It calls vkEndCommandBuffer, and later either vkQueueSubmit or vkQueueSubmit2KHR filling up the semaphores from images declared as dependencies.

You have called GstVulkan.VulkanOperation.begin() before. GstVulkan.VulkanOperation.reset() is called internally if something fails

end_query(id)
Parameters:

id (int) –

Returns:

whether the end command was set

Return type:

bool

Ends a query operation in the current command buffer.

get_query()
Raises:

GLib.Error

Returns:

whether a status was fetched. If not, it might populate error

data:

result of all queries

Return type:

(bool, data: object)

Gets the latest operation results of all the queries in data. API users have to parse the binary array of data according of their needs (usually is a guint32 array of size of n_query).

Don’t free data.

pipeline_barrier2(dependency_info)
Parameters:

dependency_info (object or None) – a pointer to VkDependencyInfo

Returns:

True if vkCmdPipelineBarrier2{KHR} it’s available. False, otherwise.

Return type:

bool

It’s a wrapper to vkCmdPipelineBarrier2{KHR} if it’s available.

reset()

Resets the operation to a clean state.

update_frame(frame, dst_stage, new_access, new_layout, new_queue)
Parameters:

Add or update the internal list of the future state of frame. This state will be set after GstVulkan.VulkanOperation.end().

This method is useful when new barriers are added to the array without using GstVulkan.VulkanOperation.add_frame_barrier().

use_sync2()
Returns:

whether the operations are using synchronization2 extension.

Return type:

bool

wait()
Returns:

whether the operation succeed.

Return type:

bool

Waits for the operation’s fence to signal.

Property Details

GstVulkan.VulkanOperation.props.command_pool
Name:

command-pool

Type:

GstVulkan.VulkanCommandPool

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Vulkan Command Pool