Method

MaplibreNativeFfiAcquiredFrameget_dma_buf

Declaration [src]

MaplibreNativeFfiDmaBufFrame*
maplibre_native_ffi_acquired_frame_get_dma_buf (
  MaplibreNativeFfiAcquiredFrame* self
  GError** error
)

Description [src]

Gets the dmabuf of an acquired frame.

Wait for maplibre_native_ffi_acquired_frame_get_producer_sync() before you read the buffer. Once you release or discard the frame, the session may render into the buffer again. You can map a buffer with DRM_FORMAT_MOD_LINEAR, which has one plane, with mmap, and bracket your reads with DMA_BUF_IOCTL_SYNC.

The session owns the planes’ file descriptors, so don’t close them. To keep the buffer after you release the frame, duplicate each file descriptor with dup. A duplicate keeps the buffer’s memory, but not its contents.

See mln_acquired_frame_get_dma_buf in the C API reference.

It fails with these errors:

  • MAPLIBRE_NATIVE_FFI_ERROR_TARGET_LOST when the session failed, or you detached, abandoned, or disposed it.

Return value

Type: MaplibreNativeFfiDmaBufFrame

The value.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.