Package org.freedesktop.gstreamer.audio
Class DsdPlaneOffsetMeta
java.lang.Object
org.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.
- Since:
- 1.24
-
Constructor Summary
ConstructorsConstructorDescriptionAllocate 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 MetaInfogetInfo()static MemoryLayoutThe memory layout of the native struct.@Nullable MetareadMeta()Read the value of the fieldmeta.longRead the value of the fieldnum_bytes_per_channel.intRead the value of the fieldnum_channels.Read the value of the fieldoffsets.@org.jspecify.annotations.Nullable long @Nullable []Read the value of the fieldpriv_offsets_arr.voidWrite a value in the fieldmeta.voidwriteNumBytesPerChannel(long numBytesPerChannel) Write a value in the fieldnum_bytes_per_channel.voidwriteNumChannels(int numChannels) Write a value in the fieldnum_channels.voidwriteOffsets(MemorySegment offsets) Write a value in the fieldoffsets.voidwritePrivOffsetsArr(@org.jspecify.annotations.Nullable long @Nullable [] privOffsetsArr, Arena _arena) Write a value in the fieldpriv_offsets_arr.Methods inherited from class org.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 fieldmetanumChannels- value for the fieldnumChannelsnumBytesPerChannel- value for the fieldnumBytesPerChanneloffsets- value for the fieldoffsetsprivOffsetsArr- value for the fieldprivOffsetsArrarena- 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 fieldmetanumChannels- value for the fieldnumChannelsnumBytesPerChannel- value for the fieldnumBytesPerChanneloffsets- value for the fieldoffsetsprivOffsetsArr- value for the fieldprivOffsetsArr
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readMeta
Read the value of the fieldmeta.- Returns:
- The value of the field
meta
-
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 @org.jspecify.annotations.Nullable long @Nullable [] readPrivOffsetsArr()Read the value of the fieldpriv_offsets_arr.- Returns:
- The value of the field
priv_offsets_arr
-
writePrivOffsetsArr
public void writePrivOffsetsArr(@org.jspecify.annotations.Nullable long @Nullable [] privOffsetsArr, Arena _arena) Write a value in the fieldpriv_offsets_arr.- Parameters:
privOffsetsArr- The new value for the fieldpriv_offsets_arr
-
getInfo
-