Class AudioInfo

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

@Generated("org.javagi.JavaGI") public class AudioInfo extends ProxyInstance

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 Details

    • AudioInfo

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

      public AudioInfo()
      Allocate a new GstAudioInfo that is also initialized with gst_audio_info_init().
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the AudioInfo class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readFinfo

      public AudioFormatInfo readFinfo()
      Read the value of the field finfo.
      Returns:
      The value of the field finfo
    • writeFinfo

      public void writeFinfo(AudioFormatInfo finfo)
      Write a value in the field finfo.
      Parameters:
      finfo - The new value for the field finfo
    • readFlags

      public Set<AudioFlags> readFlags()
      Read the value of the field flags.
      Returns:
      The value of the field flags
    • writeFlags

      public void writeFlags(Set<AudioFlags> flags)
      Write a value in the field flags.
      Parameters:
      flags - The new value for the field flags
    • readLayout

      public AudioLayout readLayout()
      Read the value of the field layout.
      Returns:
      The value of the field layout
    • writeLayout

      public void writeLayout(AudioLayout layout)
      Write a value in the field layout.
      Parameters:
      layout - The new value for the field layout
    • readRate

      public int readRate()
      Read the value of the field rate.
      Returns:
      The value of the field rate
    • writeRate

      public void writeRate(int rate)
      Write a value in the field rate.
      Parameters:
      rate - The new value for the field rate
    • readChannels

      public int readChannels()
      Read the value of the field channels.
      Returns:
      The value of the field channels
    • writeChannels

      public void writeChannels(int channels)
      Write a value in the field channels.
      Parameters:
      channels - The new value for the field channels
    • readBpf

      public int readBpf()
      Read the value of the field bpf.
      Returns:
      The value of the field bpf
    • writeBpf

      public void writeBpf(int bpf)
      Write a value in the field bpf.
      Parameters:
      bpf - The new value for the field bpf
    • readPosition

      public @Nullable AudioChannelPosition @Nullable [] readPosition()
      Read the value of the field position.
      Returns:
      The value of the field position
    • writePosition

      public void writePosition(@Nullable AudioChannelPosition @Nullable [] position, Arena _arena)
      Write a value in the field position.
      Parameters:
      position - The new value for the field position
    • fromCaps

      public static @Nullable AudioInfo fromCaps(Caps caps)
      Parse caps to generate a GstAudioInfo.
      Parameters:
      caps - a GstCaps
      Returns:
      A GstAudioInfo, or null if caps couldn't be parsed
      Since:
      1.20
    • withCaps

      public static boolean withCaps(AudioInfo info, Caps caps)
      Parse caps and update info.
      Parameters:
      info - a GstAudioInfo
      caps - a GstCaps
      Returns:
      TRUE if caps could be parsed
    • init

      public static void init(AudioInfo info)
      Initialize info with default values.
      Parameters:
      info - a GstAudioInfo
    • convert

      public boolean convert(Format srcFmt, long srcVal, Format destFmt, Out<Long> destVal)
      Converts among various GstFormat 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 the srcVal
      srcVal - value to convert
      destFmt - GstFormat of the destVal
      destVal - pointer to destination value
      Returns:
      TRUE if the conversion was successful.
    • copy

      public AudioInfo 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

      public boolean isEqual(AudioInfo other)
      Compares two GstAudioInfo and returns whether they are equal or not
      Parameters:
      other - a GstAudioInfo
      Returns:
      true if this AudioInfo and other are equal, else false.
      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 of format and rate and channels.

      Note: This initializes this AudioInfo first, no values are preserved.

      Parameters:
      format - the format
      rate - the samplerate
      channels - the number of channels
      position - the channel positions
      Throws:
      IllegalArgumentException - when length of position is less than 64
    • toCaps

      public Caps toCaps()
      Convert the values of this AudioInfo into a GstCaps.
      Returns:
      the new GstCaps containing the info of info.