Skip to main content
Version: 14 Oct 2024

NativeBindings

Inherits from:
MagicLeapNativeBindings

Public Methods

MLResult.Code MLNativeSurfaceAcquireHardwareBufferFromNativeBuffer

public MLResult.Code MLNativeSurfaceAcquireHardwareBufferFromNativeBuffer(
ulong handle,
ulong native_buffer,
out IntPtr hardwareBuffer,
out uint width,
out uint height
)

Parameters

TypeNameDescription
ulonghandle
ulongnative_buffer
out IntPtrhardwareBuffer
out uintwidth
out uintheight

MLResult.Code MLNativeSurfaceAcquireNextAvailableFrame

public MLResult.Code MLNativeSurfaceAcquireNextAvailableFrame(
ulong handle,
out ulong nativeBuffer
)

Parameters

TypeNameDescription
ulonghandle
out ulongnativeBuffer

MLResult.Code MLNativeSurfaceCreate

public MLResult.Code MLNativeSurfaceCreate(
ref MLNativeSurfaceConfig configValues,
out ulong handle
)

Parameters

TypeNameDescription
ref MLNativeSurfaceConfigconfigValues
out ulonghandle

MLResult.Code MLNativeSurfaceGetFrameCropRect

public MLResult.Code MLNativeSurfaceGetFrameCropRect(
ulong handle,
out MLRecti cropRect
)

Parameters

TypeNameDescription
ulonghandle
out MLRecticropRect2D rectangle with integer values in native format.

MLResult.Code MLNativeSurfaceGetFrameNumber

public MLResult.Code MLNativeSurfaceGetFrameNumber(
ulong handle,
out ulong number
)

Parameters

TypeNameDescription
ulonghandle
out ulongnumber

MLResult.Code MLNativeSurfaceGetFrameQueueBufferTimestamp

public MLResult.Code MLNativeSurfaceGetFrameQueueBufferTimestamp(
ulong handle,
out long timestampNs
)

Parameters

TypeNameDescription
ulonghandle
out longtimestampNs

MLResult.Code MLNativeSurfaceGetFrameTimestamp

public MLResult.Code MLNativeSurfaceGetFrameTimestamp(
ulong handle,
out long timestampNs
)

Parameters

TypeNameDescription
ulonghandle
out longtimestampNs

MLResult.Code MLNativeSurfaceGetFrameTransformationMatrix

public MLResult.Code MLNativeSurfaceGetFrameTransformationMatrix(
ulong handle,
float [] OutMtx
)

Parameters

TypeNameDescription
ulonghandle
float []OutMtx

MLResult.Code MLNativeSurfaceRelease

public MLResult.Code MLNativeSurfaceRelease(
ulong handle
)

Parameters

TypeNameDescription
ulonghandle

MLResult.Code MLNativeSurfaceReleaseFrame

public MLResult.Code MLNativeSurfaceReleaseFrame(
ulong handle,
ulong native_buffer
)

Parameters

TypeNameDescription
ulonghandle
ulongnative_buffer

MLResult.Code MLNativeSurfaceSetOnFrameAvailableCallback

public MLResult.Code MLNativeSurfaceSetOnFrameAvailableCallback(
ulong handle,
ref MLNativeSurfaceOnFrameAvailableCallback callback,
IntPtr userData
)

Parameters

TypeNameDescription
ulonghandle
ref MLNativeSurfaceOnFrameAvailableCallbackcallback
IntPtruserData

delegate void OnFrameAvailable

public delegate void OnFrameAvailable(
ulong handle,
ref MLNativeSurfaceFrameAvailableInfo info
)

Parameters

TypeNameDescription
ulonghandle
ref MLNativeSurfaceFrameAvailableInfoinfo

Public Enums

MLNativeSurfaceAcquiredBufferCount

EnumeratorValueDescription
Min1
Max16