DmaBufImporter

Imports Linux DMA-BUF planes as color buffers that sample the DMA-BUF directly, without copying it.

Importers are created by drivers that implement DmaBufImporterFactory. All functions must be called on the thread that draws.

Since

openrndr 0.5.1

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract override fun close()

Waits for the GPU, runs all pending actions and destroys the imported color buffers

Link copied to clipboard
abstract fun import(fd: Int, width: Int, height: Int, fourcc: Int, offset: Int, pitch: Int, modifier: Long): ColorBuffer?

Returns a color buffer that samples a single plane DMA-BUF image of width x height pixels in the DRM format fourcc, stored at offset in the DMA-BUF fd with rows of pitch bytes. modifier is the DRM format modifier of the DMA-BUF, or DRM_FORMAT_MOD_INVALID when it is not known.

Link copied to clipboard
abstract fun release(colorBuffer: ColorBuffer)

Destroys colorBuffer, a color buffer returned by import

Link copied to clipboard
abstract fun runWhenGpuFinished(action: () -> Unit)

Runs action once the GPU has finished the commands issued so far, use it to release a DMA-BUF only after the GPU is done sampling it

Link copied to clipboard
abstract fun update()

Runs the actions passed to runWhenGpuFinished whose commands have finished