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.CapswithGstAudio.AudioInfo.from_caps().Use the provided macros to access the info in this structure.
- classmethod from_caps(caps)[source]¶
- Parameters:
- Returns:
Trueif 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.AudioInfothat is also initialized withGstAudio.AudioInfo.init().
- classmethod new_from_caps(caps)[source]¶
- Parameters:
- Returns:
A
GstAudio.AudioInfo, orNoneif 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.Formatof the src_valsrc_val (
int) – value to convertdest_fmt (
Gst.Format) –Gst.Formatof the dest_val
- Returns:
Trueif the conversion was successful.- dest_val:
pointer to destination value
- Return type:
Converts among various
Gst.Formattypes. This function handlesGst.Format.BYTES,Gst.Format.TIME, andGst.Format.DEFAULT. For raw audio,Gst.Format.DEFAULTcorresponds 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.AudioInfostructure.
- free()[source]¶
Free a
GstAudio.AudioInfostructure previously allocated withGstAudio.AudioInfo.new() orGstAudio.AudioInfo.copy().
- is_equal(other)[source]¶
- Parameters:
other (
GstAudio.AudioInfo) – aGstAudio.AudioInfo- Returns:
- Return type:
Compares two
GstAudio.AudioInfoand 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.