Package org.freedesktop.gstreamer.audio
Class AudioInfo
java.lang.Object
org.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
ConstructorsConstructorDescriptionAllocate a newGstAudioInfothat 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 TypeMethodDescriptionbooleanConverts among variousGstFormattypes.copy()Copy a GstAudioInfo structure.voidfree()Free a GstAudioInfo structure previously allocated with gst_audio_info_new() or gst_audio_info_copy().static AudioInfoParsecapsto generate aGstAudioInfo.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the AudioInfo classstatic voidInitializeinfowith default values.booleanCompares twoGstAudioInfoand returns whether they are equal or notintreadBpf()Read the value of the fieldbpf.intRead the value of the fieldchannels.Read the value of the fieldfinfo.Read the value of the fieldflags.Read the value of the fieldlayout.@Nullable AudioChannelPosition @Nullable []Read the value of the fieldposition.intreadRate()Read the value of the fieldrate.voidsetFormat(AudioFormat format, int rate, int channels, @Nullable AudioChannelPosition @Nullable [] position) Set the default info for the audio info offormatandrateandchannels.toCaps()Convert the values of this AudioInfo into aGstCaps.static booleanParsecapsand updateinfo.voidwriteBpf(int bpf) Write a value in the fieldbpf.voidwriteChannels(int channels) Write a value in the fieldchannels.voidwriteFinfo(AudioFormatInfo finfo) Write a value in the fieldfinfo.voidwriteFlags(Set<AudioFlags> flags) Write a value in the fieldflags.voidwriteLayout(AudioLayout layout) Write a value in the fieldlayout.voidwritePosition(@Nullable AudioChannelPosition @Nullable [] position, Arena _arena) Write a value in the fieldposition.voidwriteRate(int rate) Write a value in the fieldrate.Methods inherited from class org.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 newGstAudioInfothat 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
-
fromCaps
-
withCaps
-
init
Initializeinfowith default values.- Parameters:
info- aGstAudioInfo
-
convert
Converts among variousGstFormattypes. 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-GstFormatof thesrcValsrcVal- value to convertdestFmt-GstFormatof thedestValdestVal- 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 twoGstAudioInfoand returns whether they are equal or not- Parameters:
other- aGstAudioInfo- Returns:
trueif this AudioInfo andotherare equal, elsefalse.- Since:
- 1.2
-
setFormat
public void setFormat(AudioFormat format, int rate, int channels, @Nullable AudioChannelPosition @Nullable [] position) Set the default info for the audio info offormatandrateandchannels.Note: This initializes this AudioInfo first, no values are preserved.
- Parameters:
format- the formatrate- the sampleratechannels- the number of channelsposition- the channel positions- Throws:
IllegalArgumentException- when length ofpositionis less than 64
-
toCaps
Convert the values of this AudioInfo into aGstCaps.- Returns:
- the new
GstCapscontaining the info ofinfo.
-