GstAudio.AudioInfo¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
bpf |
r/w |
the number of bytes for one frame, this is the size of one sample * channels |
|
channels |
r/w |
the number of channels |
|
finfo |
r/w |
the format info of the audio |
|
flags |
r/w |
additional audio flags |
|
layout |
r/w |
audio layout |
|
position |
r/w |
the positions for each channel |
|
rate |
r/w |
the audio sample rate |
Methods¶
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstAudio.AudioInfo¶
Information describing audio properties. This information can be filled in from
Gst.Caps
withGstAudio.AudioInfo.from_caps
().Use the provided macros to access the info in this structure.
- classmethod from_caps(caps)[source]¶
- Parameters:
- Returns:
True
if caps could be parsed- info:
- Return type:
(
bool
, info:GstAudio.AudioInfo
)
Parse caps and update info.
- classmethod init()[source]¶
- Returns:
- Return type:
info:
GstAudio.AudioInfo
Initialize info with default values.
- classmethod new()[source]¶
- Returns:
a new
GstAudio.AudioInfo
. free withGstAudio.AudioInfo.free
().- Return type:
Allocate a new
GstAudio.AudioInfo
that is also initialized withGstAudio.AudioInfo.init
().
- classmethod new_from_caps(caps)[source]¶
- Parameters:
- Returns:
A
GstAudio.AudioInfo
, orNone
if caps couldn’t be parsed- Return type:
Parse caps to generate a
GstAudio.AudioInfo
.New in version 1.20.
- convert(src_fmt, src_val, dest_fmt)[source]¶
- Parameters:
src_fmt (
Gst.Format
) –Gst.Format
of the src_valsrc_val (
int
) – value to convertdest_fmt (
Gst.Format
) –Gst.Format
of the dest_val
- Returns:
True
if the conversion was successful.- dest_val:
pointer to destination value
- Return type:
Converts among various
Gst.Format
types. This function handlesGst.Format.BYTES
,Gst.Format.TIME
, andGst.Format.DEFAULT
. For raw audio,Gst.Format.DEFAULT
corresponds to audio frames. This function can be used to handle pad queries of the typeGst.QueryType.CONVERT
.
- copy()[source]¶
- Returns:
a new
GstAudio.AudioInfo
. free withGstAudio.AudioInfo.free
.- Return type:
Copy a
GstAudio.AudioInfo
structure.
- free()[source]¶
Free a
GstAudio.AudioInfo
structure previously allocated withGstAudio.AudioInfo.new
() orGstAudio.AudioInfo.copy
().
- is_equal(other)[source]¶
- Parameters:
other (
GstAudio.AudioInfo
) – aGstAudio.AudioInfo
- Returns:
- Return type:
Compares two
GstAudio.AudioInfo
and returns whether they are equal or notNew in version 1.2.
- set_format(format, rate, channels, position)[source]¶
- Parameters:
format (
GstAudio.AudioFormat
) – the formatrate (
int
) – the sampleratechannels (
int
) – the number of channelsposition ([
GstAudio.AudioChannelPosition
] orNone
) – the channel positions
Set the default info for the audio info of format and rate and channels.
Note: This initializes self first, no values are preserved.