GstVulkan.VulkanDecoder

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

append_slice (pic, data, size, add_startcode)

caps ()

create_dpb_pool (caps)

decode (pic)

flush ()

is_started ()

picture_create_view (buf, is_out)

picture_init (pic, out)

profile_caps ()

start (profile)

stop ()

update_video_session_parameters (params)

update_ycbcr_sampler (range, xloc, yloc)

wait ()

Virtual Methods

Inherited:

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

Properties

Inherited:

Gst.Object (2)

Signals

Inherited:

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

Fields

Inherited:

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

Name

Type

Access

Description

codec

int

r

the configured video codec operation

dedicated_dpb

bool

r

if decoder needs a dedicated DPB

input_buffer

Gst.Buffer

r

the buffer to upload the bitstream to decode

layered_buffer

Gst.Buffer

r

layered_dpb

bool

r

if decoder’s dedicated DPB has to be a layered image

parent

Gst.Object

r

the parent Gst.Object

profile

GstVulkan.VulkanVideoProfile

r

the configured GstVulkan.VulkanVideoProfile

queue

GstVulkan.VulkanQueue

r

the GstVulkan.VulkanQueue to command buffers will be allocated from

Class Details

class GstVulkan.VulkanDecoder(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstVulkan.VulkanDecoderClass

New in version 1.24.

append_slice(pic, data, size, add_startcode)
Parameters:
Returns:

whether the slice data were added.

Return type:

bool

Appends slices’s data bitstream into pic internal input buffer.

caps()
Returns:

whether the capabilities were fetched correctly.

caps:

a GstVulkan.VulkanVideoCapabilities

Return type:

(bool, caps: GstVulkan.VulkanVideoCapabilities)

Gets the Vulkan decoding capabilities of the current video session.

create_dpb_pool(caps)
Parameters:

caps (Gst.Caps) – the Gst.Caps of the DP

Returns:

whether the pool was created.

Return type:

bool

Instantiates an internal Vulkan image pool for driver decoders whose output buffers cannot be used as DPB buffers.

decode(pic)
Parameters:

pic (GstVulkan.VulkanDecoderPicture) – a GstVulkan.VulkanDecoderPicture

Raises:

GLib.Error

Returns:

whether pic was decoded correctly. It might fill error.

Return type:

bool

Decodes pic.

flush()
Raises:

GLib.Error

Returns:

whether flush was successful

Return type:

bool

Initializes the decoder at driver level and set its DPB slots to the inactive state.

is_started()
Returns:

whether GstVulkan.VulkanDecoder.start() was called correctly previously.

Return type:

bool

picture_create_view(buf, is_out)
Parameters:
Returns:

the GstVulkan.VulkanImageView.

Return type:

GstVulkan.VulkanImageView or None

Creates a GstVulkan.VulkanImageView for buf for decoding, with the internal Ycbcr sampler, if available.

picture_init(pic, out)
Parameters:
Returns:

whether pic was initialized.

Return type:

bool

Initializes pic with out as output buffer.

profile_caps()
Returns:

the Gst.Caps of the profile defined at GstVulkan.VulkanDecoder.start().

Return type:

Gst.Caps

start(profile)
Parameters:

profile (GstVulkan.VulkanVideoProfile) – a GstVulkan.VulkanVideoProfile

Raises:

GLib.Error

Returns:

whether the video decoder has started correctly.

Return type:

bool

It creates a Vulkan video session for the given profile. If an error occurs, error is filled.

stop()
Returns:

whether the decoder stopped correctly.

Return type:

bool

Destroys the video session created at GstVulkan.VulkanDecoder.start() and clean up the internal objects.

update_video_session_parameters(params)
Parameters:

params (GstVulkan.VulkanDecoderParameters) – a GstVulkan.VulkanDecoderParameters union

Raises:

GLib.Error

Returns:

whether the params were updated internally. It might fill error.

Return type:

bool

Update the internal codec parameters for the current video session.

update_ycbcr_sampler(range, xloc, yloc)
Parameters:
  • range (Vulkan.SamplerYcbcrRange) – whether color components are encoded using the full range of numerical values or whether values are reserved for headroom and foot room.

  • xloc (Vulkan.ChromaLocation) – x location of downsampled chroma component samples relative to the luma samples.

  • yloc (Vulkan.ChromaLocation) – y location of downsampled chroma component samples relative to the luma samples.

Raises:

GLib.Error

Returns:

whether the sampler was updated.

Return type:

bool

Update the internal Ycbcr sampler for the output images.

wait()
Returns:

whether the wait succeeded in waiting for all the fences to be freed.

Return type:

bool

Waits indefinitely for decoding fences to signal, and queries the operation result if available.