Class OpusHead

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class OpusHead extends Struct<OpusHead> implements NativeResource

 struct OpusHead {
     int version;
     int channel_count;
     unsigned int pre_skip;
     opus_uint32 input_sample_rate;
     int output_gain;
     int mapping_family;
     int stream_count;
     int coupled_count;
     unsigned char mapping[255];
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • VERSION

      public static final int VERSION
      The struct member offsets.
    • CHANNEL_COUNT

      public static final int CHANNEL_COUNT
      The struct member offsets.
    • PRE_SKIP

      public static final int PRE_SKIP
      The struct member offsets.
    • INPUT_SAMPLE_RATE

      public static final int INPUT_SAMPLE_RATE
      The struct member offsets.
    • OUTPUT_GAIN

      public static final int OUTPUT_GAIN
      The struct member offsets.
    • MAPPING_FAMILY

      public static final int MAPPING_FAMILY
      The struct member offsets.
    • STREAM_COUNT

      public static final int STREAM_COUNT
      The struct member offsets.
    • COUPLED_COUNT

      public static final int COUPLED_COUNT
      The struct member offsets.
    • MAPPING

      public static final int MAPPING
      The struct member offsets.
  • Constructor Details

    • OpusHead

      public OpusHead(ByteBuffer container)
      Creates a OpusHead instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<OpusHead>
    • version

      public int version()
      Returns:
      the value of the version field.
    • channel_count

      public int channel_count()
      Returns:
      the value of the channel_count field.
    • pre_skip

      public int pre_skip()
      Returns:
      the value of the pre_skip field.
    • input_sample_rate

      public int input_sample_rate()
      Returns:
      the value of the input_sample_rate field.
    • output_gain

      public int output_gain()
      Returns:
      the value of the output_gain field.
    • mapping_family

      public int mapping_family()
      Returns:
      the value of the mapping_family field.
    • stream_count

      public int stream_count()
      Returns:
      the value of the stream_count field.
    • coupled_count

      public int coupled_count()
      Returns:
      the value of the coupled_count field.
    • mapping

      public ByteBuffer mapping()
      Returns:
      a ByteBuffer view of the mapping field.
    • mapping

      public byte mapping(int index)
      Returns:
      the value at the specified index of the mapping field.
    • malloc

      public static OpusHead malloc()
      Returns a new OpusHead instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static OpusHead calloc()
      Returns a new OpusHead instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static OpusHead create()
      Returns a new OpusHead instance allocated with BufferUtils.
    • create

      public static OpusHead create(long address)
      Returns a new OpusHead instance for the specified memory address.
    • createSafe

      public static @Nullable OpusHead createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static OpusHead.Buffer malloc(int capacity)
      Returns a new OpusHead.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static OpusHead.Buffer calloc(int capacity)
      Returns a new OpusHead.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static OpusHead.Buffer create(int capacity)
      Returns a new OpusHead.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static OpusHead.Buffer create(long address, int capacity)
      Create a OpusHead.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable OpusHead.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static OpusHead malloc(MemoryStack stack)
      Returns a new OpusHead instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static OpusHead calloc(MemoryStack stack)
      Returns a new OpusHead instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static OpusHead.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new OpusHead.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static OpusHead.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new OpusHead.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nversion

      public static int nversion(long struct)
      Unsafe version of version().
    • nchannel_count

      public static int nchannel_count(long struct)
      Unsafe version of channel_count().
    • npre_skip

      public static int npre_skip(long struct)
      Unsafe version of pre_skip().
    • ninput_sample_rate

      public static int ninput_sample_rate(long struct)
      Unsafe version of input_sample_rate().
    • noutput_gain

      public static int noutput_gain(long struct)
      Unsafe version of output_gain().
    • nmapping_family

      public static int nmapping_family(long struct)
      Unsafe version of mapping_family().
    • nstream_count

      public static int nstream_count(long struct)
      Unsafe version of stream_count().
    • ncoupled_count

      public static int ncoupled_count(long struct)
      Unsafe version of coupled_count().
    • nmapping

      public static ByteBuffer nmapping(long struct)
      Unsafe version of mapping().
    • nmapping

      public static byte nmapping(long struct, int index)
      Unsafe version of mapping.