Class DmabufFormats

java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gdk.DmabufFormats
All Implemented Interfaces:
Proxy

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

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, Out, Out).

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.

Since:
4.14
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a DmabufFormats proxy instance for the provided memory address.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(int fourcc, long modifier)
    Returns whether a given format is contained in formats.
    boolean
    equal(@Nullable DmabufFormats formats2)
    Returns whether this DmabufFormats and formats2 contain the same dmabuf formats, in the same order.
    void
    getFormat(long idx, Out<Integer> fourcc, Out<Long> modifier)
    Gets the fourcc code and modifier for a format that is contained in formats.
    The memory layout of the native struct.
    long
    Returns the number of formats that the this DmabufFormats object contains.
    static @Nullable Type
    Get the GType of the DmabufFormats class.
    ref()
    Increases the reference count of formats.
    void
    Decreases the reference count of formats.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DmabufFormats

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

    • getType

      public static @Nullable Type getType()
      Get the GType of the DmabufFormats class.
      Returns:
      the GType
    • getMemoryLayout

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

      public boolean contains(int fourcc, long modifier)
      Returns whether a given format is contained in formats.
      Parameters:
      fourcc - a format code
      modifier - a format modifier
      Returns:
      TRUE if the format specified by the arguments is part of this DmabufFormats
      Since:
      4.14
    • equal

      public boolean equal(@Nullable DmabufFormats formats2)
      Returns whether this DmabufFormats and formats2 contain the same dmabuf formats, in the same order.
      Parameters:
      formats2 - another GdkDmabufFormats
      Returns:
      TRUE if this DmabufFormats and formats2 are equal
      Since:
      4.14
    • getFormat

      public void getFormat(long idx, Out<Integer> fourcc, Out<Long> modifier)
      Gets the fourcc code and modifier for a format that is contained in formats.
      Parameters:
      idx - the index of the format to return
      fourcc - return location for the format code
      modifier - return location for the format modifier
      Since:
      4.14
    • 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
      Since:
      4.14
    • ref

      public DmabufFormats ref()
      Increases the reference count of formats.
      Returns:
      the passed-in object
      Since:
      4.14
    • unref

      public void unref()

      Decreases the reference count of formats.

      When the reference count reaches zero, the object is freed.

      Since:
      4.14