GstAudio.AudioInfo

Fields

Name

Type

Access

Description

bpf

int

r/w

the number of bytes for one frame, this is the size of one sample * channels

channels

int

r/w

the number of channels

finfo

GstAudio.AudioFormatInfo

r/w

the format info of the audio

flags

GstAudio.AudioFlags

r/w

additional audio flags

layout

GstAudio.AudioLayout

r/w

audio layout

position

[GstAudio.AudioChannelPosition]

r/w

the positions for each channel

rate

int

r/w

the audio sample rate

Methods

class

from_caps (caps)

class

init ()

class

new ()

class

new_from_caps (caps)

convert (src_fmt, src_val, dest_fmt)

copy ()

free ()

is_equal (other)

set_format (format, rate, channels, position)

to_caps ()

Details

class GstAudio.AudioInfo

Information describing audio properties. This information can be filled in from Gst.Caps with GstAudio.AudioInfo.from_caps().

Use the provided macros to access the info in this structure.

classmethod from_caps(caps)
Parameters:

caps (Gst.Caps) – a Gst.Caps

Returns:

True if caps could be parsed

info:

a GstAudio.AudioInfo

Return type:

(bool, info: GstAudio.AudioInfo)

Parse caps and update info.

classmethod init()
Returns:

a GstAudio.AudioInfo

Return type:

info: GstAudio.AudioInfo

Initialize info with default values.

classmethod new()
Returns:

a new GstAudio.AudioInfo. free with GstAudio.AudioInfo.free().

Return type:

GstAudio.AudioInfo

Allocate a new GstAudio.AudioInfo that is also initialized with GstAudio.AudioInfo.init().

classmethod new_from_caps(caps)
Parameters:

caps (Gst.Caps) – a Gst.Caps

Returns:

A GstAudio.AudioInfo, or None if caps couldn’t be parsed

Return type:

GstAudio.AudioInfo or None

Parse caps to generate a GstAudio.AudioInfo.

New in version 1.20.

convert(src_fmt, src_val, dest_fmt)
Parameters:
Returns:

True if the conversion was successful.

dest_val:

pointer to destination value

Return type:

(bool, dest_val: int)

Converts among various Gst.Format types. This function handles Gst.Format.BYTES, Gst.Format.TIME, and Gst.Format.DEFAULT. For raw audio, Gst.Format.DEFAULT corresponds to audio frames. This function can be used to handle pad queries of the type Gst.QueryType.CONVERT.

copy()
Returns:

a new GstAudio.AudioInfo. free with GstAudio.AudioInfo.free.

Return type:

GstAudio.AudioInfo

Copy a GstAudio.AudioInfo structure.

free()

Free a GstAudio.AudioInfo structure previously allocated with GstAudio.AudioInfo.new() or GstAudio.AudioInfo.copy().

is_equal(other)
Parameters:

other (GstAudio.AudioInfo) – a GstAudio.AudioInfo

Returns:

True if self and other are equal, else False.

Return type:

bool

Compares two GstAudio.AudioInfo and returns whether they are equal or not

New in version 1.2.

set_format(format, rate, channels, position)
Parameters:

Set the default info for the audio info of format and rate and channels.

Note: This initializes self first, no values are preserved.

to_caps()
Returns:

the new Gst.Caps containing the info of self.

Return type:

Gst.Caps

Convert the values of self into a Gst.Caps.