Class DmabufFormats
- All Implemented Interfaces:
Proxy
GdkDmabufFormats
struct provides information about
supported DMA buffer formats.
You can query whether a given format is supported with
contains(int, long)
and you can iterate
over the list of all supported formats with
getNFormats()
and
getFormat(long, io.github.jwharm.javagi.base.Out<java.lang.Integer>, io.github.jwharm.javagi.base.Out<java.lang.Long>)
.
The list of supported formats is sorted by preference, with the best formats coming first.
The list may contains (format, modifier) pairs where the modifier
is DMA_FORMAT_MOD_INVALID
, indicating that **_implicit modifiers_**
may be used with this format.
See DmabufTextureBuilder
for more information
about DMA buffers.
Note that DMA buffers only exist on Linux.
-
Constructor Summary
ConstructorDescriptionDmabufFormats
(MemorySegment address) Create a DmabufFormats proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(int fourcc, long modifier) Returns whether a given format is contained in this DmabufFormats.boolean
equal
(@Nullable DmabufFormats formats2) Returns whether this DmabufFormats andformats2
contain the same dmabuf formats, in the same order.void
Gets the fourcc code and modifier for a format that is contained in this DmabufFormats.long
Returns the number of formats that the this DmabufFormats object contains.static Type
getType()
Get the GType of the DmabufFormats classref()
Increases the reference count of this DmabufFormats.void
unref()
Decreases the reference count of this DmabufFormats.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
DmabufFormats
Create a DmabufFormats proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
contains
public boolean contains(int fourcc, long modifier) Returns whether a given format is contained in this DmabufFormats.- Parameters:
fourcc
- a format codemodifier
- a format modifier- Returns:
TRUE
if the format specified by the arguments is part of this DmabufFormats
-
equal
Returns whether this DmabufFormats andformats2
contain the same dmabuf formats, in the same order.- Parameters:
formats2
- anotherGdkDmabufFormats
- Returns:
TRUE
if this DmabufFormats andformats2
are equal
-
getFormat
Gets the fourcc code and modifier for a format that is contained in this DmabufFormats.- Parameters:
idx
- the index of the format to returnfourcc
- return location for the format codemodifier
- return location for the format modifier
-
getNFormats
public long getNFormats()Returns the number of formats that the this DmabufFormats object contains.Note that DMA buffers are a Linux concept, so on other platforms,
getNFormats()
will always return zero.- Returns:
- the number of formats
-
ref
Increases the reference count of this DmabufFormats.- Returns:
- the passed-in object
-
unref
public void unref()Decreases the reference count of this DmabufFormats.When the reference count reaches zero, the object is freed.
-