Class AudioChannelMixer

java.lang.Object
org.javagi.base.ProxyInstance
org.freedesktop.gstreamer.audio.AudioChannelMixer
All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class AudioChannelMixer extends ProxyInstance
  • Constructor Details

    • AudioChannelMixer

      public AudioChannelMixer(MemorySegment address)
      Create a AudioChannelMixer proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • 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 channels
      inPosition - positions of input channels
      outChannels - number of output channels
      outPosition - 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 channels
      inPosition - positions of input channels
      outChannels - number of output channels
      outPosition - 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 float[] matrix)
      Create a new channel mixer object for the given parameters.
      Parameters:
      flags - GstAudioChannelMixerFlags
      inChannels - number of input channels
      outChannels - number of output channels
      matrix - channel conversion matrix, mout_channels. If identity matrix, passthrough applies. If null, a (potentially truncated) identity matrix is generated.
      Returns:
      a new GstAudioChannelMixer object. Free with gst_audio_channel_mixer_free() after usage.
      Since:
      1.14
    • newWithMatrix

      public static AudioChannelMixer newWithMatrix(AudioChannelMixerFlags flags, AudioFormat format, int inChannels, int outChannels, @Nullable float[] matrix)
      Create a new channel mixer object for the given parameters.
      Parameters:
      flags - GstAudioChannelMixerFlags
      inChannels - number of input channels
      outChannels - number of output channels
      matrix - channel conversion matrix, mout_channels. If identity matrix, passthrough applies. If null, a (potentially truncated) identity matrix is generated.
      Returns:
      a new GstAudioChannelMixer object. Free with gst_audio_channel_mixer_free() after usage.
      Since:
      1.14
    • free

      public void free()
      Free memory allocated by mix.
    • 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 MemorySegment in, @Nullable MemorySegment out, int samples)

      In case the samples are interleaved, in and out must point to an array with a single element pointing to a block of interleaved samples.

      If non-interleaved samples are used, in and out must point to an array with pointers to memory blocks, one for each channel.

      Perform channel mixing on inData and write the result to outData. inData and outData need to be in format and layout.

      Parameters:
      in - input samples
      out - output samples
      samples - number of samples