Method

MaplibreNativeFfiRenderSessionacquire_frame

Declaration [src]

MaplibreNativeFfiAcquiredFrame*
maplibre_native_ffi_render_session_acquire_frame (
  MaplibreNativeFfiRenderSession* self
  GError** error
)

Description [src]

Takes the newest rendered frame from the session’s texture ring, if one is ready.

Older frames that you haven’t acquired are dropped, and the session can render over a frame before you acquire it. While you hold a frame in every texture of the ring, new frames wait until you release one. When no frame is ready, it succeeds and writes the null handle.

See mln_render_session_acquire_frame in the C API reference.

It fails with these errors:

  • MAPLIBRE_NATIVE_FFI_ERROR_UNSUPPORTED when the session lacks MAPLIBRE_NATIVE_FFI_RENDER_SESSION_CAPABILITY_FRAME_ACQUISITION.
  • MAPLIBRE_NATIVE_FFI_ERROR_TARGET_LOST or MAPLIBRE_NATIVE_FFI_ERROR_NATIVE_ERROR, as MaplibreNativeFfiRenderSessionSnapshot.failure_status reports, when the session has failed.
  • MAPLIBRE_NATIVE_FFI_ERROR_INVALID_STATE when you detached, abandoned, released, or disposed the session.

Return value

Type: MaplibreNativeFfiAcquiredFrame

The object.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The return value can be NULL.