Package org.freedesktop.gstreamer.audio
Class DsdPlaneOffsetMeta
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.freedesktop.gstreamer.audio.DsdPlaneOffsetMeta
- All Implemented Interfaces:
Proxy
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 [0, channels), the range
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.
-
Constructor Summary
ConstructorDescriptionAllocate a new DsdPlaneOffsetMeta.DsdPlaneOffsetMeta
(Arena arena) Allocate a new DsdPlaneOffsetMeta.DsdPlaneOffsetMeta
(MemorySegment address) Create a DsdPlaneOffsetMeta proxy instance for the provided memory address.DsdPlaneOffsetMeta
(Meta meta, int numChannels, long numBytesPerChannel, MemorySegment offsets, long[] privOffsetsArr) Allocate a new DsdPlaneOffsetMeta with the fields set to the provided values.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. -
Method Summary
Modifier and TypeMethodDescriptionstatic MetaInfo
getInfo()
static MemoryLayout
The memory layout of the native struct.readMeta()
Read the value of the fieldmeta
.long
Read the value of the fieldnum_bytes_per_channel
.int
Read the value of the fieldnum_channels
.Read the value of the fieldoffsets
.long[]
Read the value of the fieldpriv_offsets_arr
.void
Write a value in the fieldmeta
.void
writeNumBytesPerChannel
(long numBytesPerChannel) Write a value in the fieldnum_bytes_per_channel
.void
writeNumChannels
(int numChannels) Write a value in the fieldnum_channels
.void
writeOffsets
(MemorySegment offsets) Write a value in the fieldoffsets
.void
writePrivOffsetsArr
(long[] privOffsetsArr, Arena _arena) Write a value in the fieldpriv_offsets_arr
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
DsdPlaneOffsetMeta
Create a DsdPlaneOffsetMeta proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
DsdPlaneOffsetMeta
Allocate a new DsdPlaneOffsetMeta.- Parameters:
arena
- to control the memory allocation scope
-
DsdPlaneOffsetMeta
public DsdPlaneOffsetMeta()Allocate a new DsdPlaneOffsetMeta. The memory is allocated withArena.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 fieldmeta
numChannels
- value for the fieldnumChannels
numBytesPerChannel
- value for the fieldnumBytesPerChannel
offsets
- value for the fieldoffsets
privOffsetsArr
- value for the fieldprivOffsetsArr
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 withArena.ofAuto()
.- Parameters:
meta
- value for the fieldmeta
numChannels
- value for the fieldnumChannels
numBytesPerChannel
- value for the fieldnumBytesPerChannel
offsets
- value for the fieldoffsets
privOffsetsArr
- value for the fieldprivOffsetsArr
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readMeta
-
writeMeta
Write a value in the fieldmeta
.- Parameters:
meta
- The new value for the fieldmeta
-
readNumChannels
public int readNumChannels()Read the value of the fieldnum_channels
.- Returns:
- The value of the field
num_channels
-
writeNumChannels
public void writeNumChannels(int numChannels) Write a value in the fieldnum_channels
.- Parameters:
numChannels
- The new value for the fieldnum_channels
-
readNumBytesPerChannel
public long readNumBytesPerChannel()Read the value of the fieldnum_bytes_per_channel
.- Returns:
- The value of the field
num_bytes_per_channel
-
writeNumBytesPerChannel
public void writeNumBytesPerChannel(long numBytesPerChannel) Write a value in the fieldnum_bytes_per_channel
.- Parameters:
numBytesPerChannel
- The new value for the fieldnum_bytes_per_channel
-
readOffsets
Read the value of the fieldoffsets
.- Returns:
- The value of the field
offsets
-
writeOffsets
Write a value in the fieldoffsets
.- Parameters:
offsets
- The new value for the fieldoffsets
-
readPrivOffsetsArr
public long[] readPrivOffsetsArr()Read the value of the fieldpriv_offsets_arr
.- Returns:
- The value of the field
priv_offsets_arr
-
writePrivOffsetsArr
Write a value in the fieldpriv_offsets_arr
.- Parameters:
privOffsetsArr
- The new value for the fieldpriv_offsets_arr
_arena
- to control the memory allocation scope
-
getInfo
-