Package org.freedesktop.gstreamer.audio
Class AudioInfo
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.freedesktop.gstreamer.audio.AudioInfo
- All Implemented Interfaces:
Proxy
Information describing audio properties. This information can be filled
in from GstCaps with gst_audio_info_from_caps().
Use the provided macros to access the info in this structure.
-
Constructor Summary
ConstructorDescriptionAllocate a newGstAudioInfo
that is also initialized with gst_audio_info_init().AudioInfo
(MemorySegment address) Create a AudioInfo proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Converts among variousGstFormat
types.copy()
Copy a GstAudioInfo structure.void
free()
Free a GstAudioInfo structure previously allocated with gst_audio_info_new() or gst_audio_info_copy().static AudioInfo
Parsecaps
to generate aGstAudioInfo
.static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the AudioInfo classstatic void
Initializeinfo
with default values.boolean
Compares twoGstAudioInfo
and returns whether they are equal or notint
readBpf()
Read the value of the fieldbpf
.int
Read the value of the fieldchannels
.Read the value of the fieldfinfo
.Read the value of the fieldflags
.Read the value of the fieldlayout
.Read the value of the fieldposition
.int
readRate()
Read the value of the fieldrate
.void
setFormat
(AudioFormat format, int rate, int channels, @Nullable AudioChannelPosition[] position) Set the default info for the audio info offormat
andrate
andchannels
.toCaps()
Convert the values of this AudioInfo into aGstCaps
.static boolean
Parsecaps
and updateinfo
.void
writeBpf
(int bpf) Write a value in the fieldbpf
.void
writeChannels
(int channels) Write a value in the fieldchannels
.void
writeFinfo
(AudioFormatInfo finfo) Write a value in the fieldfinfo
.void
writeFlags
(Set<AudioFlags> flags) Write a value in the fieldflags
.void
writeLayout
(AudioLayout layout) Write a value in the fieldlayout
.void
writePosition
(AudioChannelPosition[] position, Arena _arena) Write a value in the fieldposition
.void
writeRate
(int rate) Write a value in the fieldrate
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AudioInfo
Create a AudioInfo proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
AudioInfo
public AudioInfo()Allocate a newGstAudioInfo
that is also initialized with gst_audio_info_init().
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readFinfo
Read the value of the fieldfinfo
.- Returns:
- The value of the field
finfo
-
writeFinfo
Write a value in the fieldfinfo
.- Parameters:
finfo
- The new value for the fieldfinfo
-
readFlags
Read the value of the fieldflags
.- Returns:
- The value of the field
flags
-
writeFlags
Write a value in the fieldflags
.- Parameters:
flags
- The new value for the fieldflags
-
readLayout
Read the value of the fieldlayout
.- Returns:
- The value of the field
layout
-
writeLayout
Write a value in the fieldlayout
.- Parameters:
layout
- The new value for the fieldlayout
-
readRate
public int readRate()Read the value of the fieldrate
.- Returns:
- The value of the field
rate
-
writeRate
public void writeRate(int rate) Write a value in the fieldrate
.- Parameters:
rate
- The new value for the fieldrate
-
readChannels
public int readChannels()Read the value of the fieldchannels
.- Returns:
- The value of the field
channels
-
writeChannels
public void writeChannels(int channels) Write a value in the fieldchannels
.- Parameters:
channels
- The new value for the fieldchannels
-
readBpf
public int readBpf()Read the value of the fieldbpf
.- Returns:
- The value of the field
bpf
-
writeBpf
public void writeBpf(int bpf) Write a value in the fieldbpf
.- Parameters:
bpf
- The new value for the fieldbpf
-
readPosition
Read the value of the fieldposition
.- Returns:
- The value of the field
position
-
writePosition
Write a value in the fieldposition
.- Parameters:
position
- The new value for the fieldposition
_arena
- to control the memory allocation scope
-
fromCaps
-
withCaps
-
init
Initializeinfo
with default values.- Parameters:
info
- aGstAudioInfo
-
convert
Converts among variousGstFormat
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_QUERY_CONVERT.- Parameters:
srcFmt
-GstFormat
of thesrcVal
srcVal
- value to convertdestFmt
-GstFormat
of thedestVal
destVal
- pointer to destination value- Returns:
- TRUE if the conversion was successful.
-
copy
Copy a GstAudioInfo structure.- Returns:
- a new
GstAudioInfo
. free with gst_audio_info_free.
-
free
public void free()Free a GstAudioInfo structure previously allocated with gst_audio_info_new() or gst_audio_info_copy(). -
isEqual
Compares twoGstAudioInfo
and returns whether they are equal or not- Parameters:
other
- aGstAudioInfo
- Returns:
true
if this AudioInfo andother
are equal, elsefalse
.
-
setFormat
public void setFormat(AudioFormat format, int rate, int channels, @Nullable @Nullable AudioChannelPosition[] position) Set the default info for the audio info offormat
andrate
andchannels
.Note: This initializes this AudioInfo first, no values are preserved.
- Parameters:
format
- the formatrate
- the sampleratechannels
- the number of channelsposition
- the channel positions
-
toCaps
Convert the values of this AudioInfo into aGstCaps
.- Returns:
- the new
GstCaps
containing the info of this AudioInfo.
-