Class DsdPlaneOffsetMeta

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

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

Buffer metadata describing planar DSD contents in the buffer. This is not needed for interleaved DSD data, and is required for non-interleaved (= planar) data.

The different channels in offsets are always in the GStreamer channel order. Zero-copy channel reordering can be implemented by swapping the values in offsets.

It is not allowed for channels to overlap in memory, i.e. for each i in offsets[i, offsets[i] + numBytesPerChannel) must not overlap with any other such range.

It is, however, allowed to have parts of the buffer memory unused, by using offsets and numBytesPerChannel in such a way that leave gaps on it. This is used to implement zero-copy clipping in non-interleaved buffers.

Obviously, due to the above, it is not safe to infer the number of valid bytes from the size of the buffer. You should always use the numBytesPerChannel variable of this metadata.

Since:
1.24
  • Constructor Details

    • DsdPlaneOffsetMeta

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

      public DsdPlaneOffsetMeta(Arena arena)
      Allocate a new DsdPlaneOffsetMeta.
      Parameters:
      arena - to control the memory allocation scope
    • DsdPlaneOffsetMeta

      public DsdPlaneOffsetMeta()
      Allocate a new DsdPlaneOffsetMeta. The memory is allocated with Arena.ofAuto().
    • DsdPlaneOffsetMeta

      public DsdPlaneOffsetMeta(Meta meta, int numChannels, long numBytesPerChannel, MemorySegment offsets, long[] privOffsetsArr, Arena arena)
      Allocate a new DsdPlaneOffsetMeta with the fields set to the provided values.
      Parameters:
      meta - value for the field meta
      numChannels - value for the field numChannels
      numBytesPerChannel - value for the field numBytesPerChannel
      offsets - value for the field offsets
      privOffsetsArr - value for the field privOffsetsArr
      arena - to control the memory allocation scope
    • DsdPlaneOffsetMeta

      public DsdPlaneOffsetMeta(Meta meta, int numChannels, long numBytesPerChannel, MemorySegment offsets, long[] privOffsetsArr)
      Allocate a new DsdPlaneOffsetMeta with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      meta - value for the field meta
      numChannels - value for the field numChannels
      numBytesPerChannel - value for the field numBytesPerChannel
      offsets - value for the field offsets
      privOffsetsArr - value for the field privOffsetsArr
  • Method Details

    • getMemoryLayout

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

      public @Nullable Meta readMeta()
      Read the value of the field meta.
      Returns:
      The value of the field meta
    • writeMeta

      public void writeMeta(@Nullable Meta meta)
      Write a value in the field meta.
      Parameters:
      meta - The new value for the field meta
    • readNumChannels

      public int readNumChannels()
      Read the value of the field num_channels.
      Returns:
      The value of the field num_channels
    • writeNumChannels

      public void writeNumChannels(int numChannels)
      Write a value in the field num_channels.
      Parameters:
      numChannels - The new value for the field num_channels
    • readNumBytesPerChannel

      public long readNumBytesPerChannel()
      Read the value of the field num_bytes_per_channel.
      Returns:
      The value of the field num_bytes_per_channel
    • writeNumBytesPerChannel

      public void writeNumBytesPerChannel(long numBytesPerChannel)
      Write a value in the field num_bytes_per_channel.
      Parameters:
      numBytesPerChannel - The new value for the field num_bytes_per_channel
    • readOffsets

      public MemorySegment readOffsets()
      Read the value of the field offsets.
      Returns:
      The value of the field offsets
    • writeOffsets

      public void writeOffsets(MemorySegment offsets)
      Write a value in the field offsets.
      Parameters:
      offsets - The new value for the field offsets
    • readPrivOffsetsArr

      public @Nullable long @Nullable [] readPrivOffsetsArr()
      Read the value of the field priv_offsets_arr.
      Returns:
      The value of the field priv_offsets_arr
    • writePrivOffsetsArr

      public void writePrivOffsetsArr(@Nullable long @Nullable [] privOffsetsArr, Arena _arena)
      Write a value in the field priv_offsets_arr.
      Parameters:
      privOffsetsArr - The new value for the field priv_offsets_arr
    • getInfo

      public static MetaInfo getInfo()