Gdk.DmabufFormats

Fields

None

Methods

contains (fourcc, modifier)

equal (formats2)

get_format (idx)

get_n_formats ()

ref ()

unref ()

Details

class Gdk.DmabufFormats

The GdkDmabufFormats struct provides information about supported DMA buffer formats.

You can query whether a given format is supported with [method`Gdk`.DmabufFormats.contains] and you can iterate over the list of all supported formats with [method`Gdk`.DmabufFormats.get_n_formats] and [method`Gdk`.DmabufFormats.get_format].

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 [class`Gdk`.DmabufTextureBuilder] for more information about DMA buffers.

Note that DMA buffers only exist on Linux.

New in version 4.14.

contains(fourcc, modifier)[source]
Parameters:
  • fourcc (int) – a format code

  • modifier (int) – a format modifier

Returns:

TRUE if the format specified by the arguments is part of self

Return type:

bool

Returns whether a given format is contained in self.

New in version 4.14.

equal(formats2)[source]
Parameters:

formats2 (Gdk.DmabufFormats or None) – another GdkDmabufFormats

Returns:

TRUE if self and formats2 are equal

Return type:

bool

Returns whether self and formats2 contain the same dmabuf formats, in the same order.

New in version 4.14.

get_format(idx)[source]
Parameters:

idx (int) – the index of the format to return

Returns:

fourcc:

return location for the format code

modifier:

return location for the format modifier

Return type:

(fourcc: int, modifier: int)

Gets the fourcc code and modifier for a format that is contained in self.

New in version 4.14.

get_n_formats()[source]
Returns:

the number of formats

Return type:

int

Returns the number of formats that the self object contains.

Note that DMA buffers are a Linux concept, so on other platforms, [method`Gdk`.DmabufFormats.get_n_formats] will always return zero.

New in version 4.14.

ref()[source]
Returns:

the passed-in object

Return type:

Gdk.DmabufFormats

Increases the reference count of self.

New in version 4.14.

unref()[source]

Decreases the reference count of self.

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

New in version 4.14.