Package org.freedesktop.gstreamer.audio
Class AudioChannelMixer
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.freedesktop.gstreamer.audio.AudioChannelMixer
- All Implemented Interfaces:
Proxy
-
Constructor Summary
ConstructorDescriptionAudioChannelMixer
(MemorySegment address) Create a AudioChannelMixer proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
free()
Free memory allocated by this AudioChannelMixer.boolean
Check if this AudioChannelMixer is in passthrough.static AudioChannelMixer
new_
(Set<AudioChannelMixerFlags> flags, AudioFormat format, int inChannels, MemorySegment inPosition, int outChannels, MemorySegment outPosition) Create a new channel mixer object for the given parameters.static AudioChannelMixer
new_
(AudioChannelMixerFlags flags, AudioFormat format, int inChannels, MemorySegment inPosition, int outChannels, MemorySegment outPosition) Create a new channel mixer object for the given parameters.static AudioChannelMixer
newWithMatrix
(Set<AudioChannelMixerFlags> flags, AudioFormat format, int inChannels, int outChannels, @Nullable MemorySegment[] matrix) Create a new channel mixer object for the given parameters.static AudioChannelMixer
newWithMatrix
(AudioChannelMixerFlags flags, AudioFormat format, int inChannels, int outChannels, @Nullable MemorySegment[] matrix) Create a new channel mixer object for the given parameters.void
samples
(@Nullable MemorySegment in, @Nullable MemorySegment out, int samples) In case the samples are interleaved,in
andout
must point to an array with a single element pointing to a block of interleaved samples.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AudioChannelMixer
Create a AudioChannelMixer proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
new_
public static AudioChannelMixer new_(Set<AudioChannelMixerFlags> flags, AudioFormat format, int inChannels, MemorySegment inPosition, int outChannels, MemorySegment outPosition) Create a new channel mixer object for the given parameters.- Parameters:
flags
-GstAudioChannelMixerFlags
inChannels
- number of input channelsinPosition
- positions of input channelsoutChannels
- number of output channelsoutPosition
- positions of output channels- Returns:
- a new
GstAudioChannelMixer
object. Free with gst_audio_channel_mixer_free() after usage.
-
new_
public static AudioChannelMixer new_(AudioChannelMixerFlags flags, AudioFormat format, int inChannels, MemorySegment inPosition, int outChannels, MemorySegment outPosition) Create a new channel mixer object for the given parameters.- Parameters:
flags
-GstAudioChannelMixerFlags
inChannels
- number of input channelsinPosition
- positions of input channelsoutChannels
- number of output channelsoutPosition
- positions of output channels- Returns:
- a new
GstAudioChannelMixer
object. Free with gst_audio_channel_mixer_free() after usage.
-
newWithMatrix
public static AudioChannelMixer newWithMatrix(Set<AudioChannelMixerFlags> flags, AudioFormat format, int inChannels, int outChannels, @Nullable @Nullable MemorySegment[] matrix) Create a new channel mixer object for the given parameters.- Parameters:
flags
-GstAudioChannelMixerFlags
inChannels
- number of input channelsoutChannels
- number of output channelsmatrix
- channel conversion matrix, mout_channels
. If identity matrix, passthrough applies. Ifnull
, a (potentially truncated) identity matrix is generated.- Returns:
- a new
GstAudioChannelMixer
object. Free with gst_audio_channel_mixer_free() after usage.
-
newWithMatrix
public static AudioChannelMixer newWithMatrix(AudioChannelMixerFlags flags, AudioFormat format, int inChannels, int outChannels, @Nullable @Nullable MemorySegment[] matrix) Create a new channel mixer object for the given parameters.- Parameters:
flags
-GstAudioChannelMixerFlags
inChannels
- number of input channelsoutChannels
- number of output channelsmatrix
- channel conversion matrix, mout_channels
. If identity matrix, passthrough applies. Ifnull
, a (potentially truncated) identity matrix is generated.- Returns:
- a new
GstAudioChannelMixer
object. Free with gst_audio_channel_mixer_free() after usage.
-
free
public void free()Free memory allocated by this AudioChannelMixer. -
isPassthrough
public boolean isPassthrough()Check if this AudioChannelMixer is in passthrough.Only N x N mix identity matrices are considered passthrough, this is determined by comparing the contents of the matrix with 0.0 and 1.0.
As this is floating point comparisons, if the values have been generated, they should be rounded up or down by explicit assignment of 0.0 or 1.0 to values within a user-defined epsilon, this code doesn't make assumptions as to what may constitute an appropriate epsilon.
- Returns:
true
is this AudioChannelMixer is passthrough.
-
samples
public void samples(@Nullable @Nullable MemorySegment in, @Nullable @Nullable MemorySegment out, int samples) In case the samples are interleaved,in
andout
must point to an array with a single element pointing to a block of interleaved samples.If non-interleaved samples are used,
in
andout
must point to an array with pointers to memory blocks, one for each channel.Perform channel mixing on
inData
and write the result tooutData
.inData
andoutData
need to be informat
andlayout
.- Parameters:
in
- input samplesout
- output samplessamples
- number of samples
-