NativeBuffer

interface NativeBuffer

An unmanaged memory pointer to a native platform buffer.

Consumers (GPU renderers, ML runtimes…) can use the pointer to unwrap the native buffer, and must release it as soon as they are done with it.

val nativeBuffer = frame.getNativeBuffer()
// your processing...
nativeBuffer.release()
frame.dispose()

Properties

Link copied to clipboard
abstract val pointer: Long

A uintptr_t to the native platform buffer, with a retain count of +1.

Functions

Link copied to clipboard
abstract fun release()

Release this reference to the platform buffer again, effectively decrementing the retain count by 1. This must always be called as soon as possible, otherwise the pipeline will stall.