@maplibre/native-ffi
    Preparing search index...

    Class AcquiredFrameHandle

    A rendered frame that the caller holds to read or show.

    See mln_acquired_frame in the C API reference.

    Hierarchy

    • Owner
      • AcquiredFrameHandle
    Index
    id: bigint

    The native handle value. It stays readable after release.

    • Gives an acquired frame back to the session once you're done reading it.

      consumerCompletion says when your GPU work that reads the texture finishes. Pass GpuSyncKind.cpuComplete when that work has already finished. The session waits for that point before it renders into the texture again. If that wait fails, such as for an OpenGL fence outside the session's share group, the session fails.

      See mln_acquired_frame_release in the C API reference.

      Errors:

      • Status.unsupported when RenderSessionCapabilities.consumerSyncKinds lacks the kind of consumerCompletion.

      Parameters

      Returns void

    • Gets the Android hardware buffer of an acquired frame.

      Wait for AcquiredFrameHandle.withProducerSync() before you read the buffer. Once you release or discard the frame, the session may render into the buffer again. A reference that you take with AHardwareBuffer_acquire keeps the buffer's memory, but not its contents.

      See mln_acquired_frame_get_android_hardware_buffer in the C API reference.

      Errors:

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

      Type Parameters

      • T

      Parameters

      Returns T

    • Gets the dmabuf of an acquired frame.

      Wait for AcquiredFrameHandle.withProducerSync() 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.

      Errors:

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

      Type Parameters

      • T

      Parameters

      Returns T

    • Gets the DXGI shared texture of an acquired frame.

      Wait for AcquiredFrameHandle.withProducerSync() before you read the texture. Once you release or discard the frame, the session may render into the texture again. Open the handle with ID3D11Device1::OpenSharedResource1 or ID3D12Device::OpenSharedHandle. A texture that you open keeps its memory, but not its contents.

      The session owns the handle, so don't close it. To keep the handle after you release the frame, duplicate it with DuplicateHandle.

      See mln_acquired_frame_get_dxgi_shared_texture in the C API reference.

      Errors:

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

      Type Parameters

      • T

      Parameters

      Returns T

    • Gets the IOSurface of an acquired frame.

      Wait for AcquiredFrameHandle.withProducerSync() before you read the surface. Once you release or discard the frame, the session may render into the surface again. For an API that takes a CVPixelBuffer, wrap the surface with CVPixelBufferCreateWithIOSurface. A reference that you take with CFRetain, or a pixel buffer that wraps the surface, keeps the surface's memory, but not its contents.

      See mln_acquired_frame_get_io_surface in the C API reference.

      Errors:

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

      Type Parameters

      • T

      Parameters

      Returns T