Skip to main content
Version: 14 Oct 2024

MLNativeSurface

NameSpace: MagicLeap

Public Fields

Handle


public ulong Handle { get; set; }


Public Methods

MLResult AcquireNextAvailableFrame

public MLResult AcquireNextAvailableFrame(
out ulong nativeBuffer
)

Parameters

TypeNameDescription
out ulongnativeBuffer

MLResult Destroy

public MLResult Destroy()

MLResult GetFrameNumber

public MLResult GetFrameNumber(
out ulong number
)

Parameters

TypeNameDescription
out ulongnumber

MLResult GetFrameQueueBufferTimestamp

public MLResult GetFrameQueueBufferTimestamp(
out long timestampNs
)

Parameters

TypeNameDescription
out longtimestampNs

MLResult GetFrameTimestamp

public MLResult GetFrameTimestamp(
out long timestampNs
)

Parameters

TypeNameDescription
out longtimestampNs

MLResult GetFrameTransformMatrix

public MLResult GetFrameTransformMatrix(
float [] frameTransformMatColMajor
)

Parameters

TypeNameDescription
float []frameTransformMatColMajor

MLNativeSurface

public MLNativeSurface(
PixelFormat pixelFormat,
ushort bufferCount,
uint width,
uint height
)

Parameters

TypeNameDescription
PixelFormatpixelFormat
ushortbufferCount
uintwidth
uintheight

MLNativeSurface

For externally owned native surface, like in the case of MLMediaRecorder

public MLNativeSurface(
ulong surfaceHandle
)

Parameters

TypeNameDescription
ulongsurfaceHandle

delegate void OnFrameAvailableDelegate

public delegate void OnFrameAvailableDelegate()

MLResult ReleaseFrame

public MLResult ReleaseFrame(
ulong nativeBuffer
)

Parameters

TypeNameDescription
ulongnativeBuffer

Public Events

OnFrameAvailable

public OnFrameAvailableDelegate OnFrameAvailable()

Public Enums

PixelFormat

EnumeratorValueDescription
Custom-4Custom
Translucent-3Translucent
Transparent-2Transparent
Opaque-1Opaque
None0None
Rgba888814x8-bit RGBA
Rgbx888824x8-bit RGBX
Rgb88833x8-bit RGB
Rgb565416-bit RGB
Bgra888854x8-bit BGRA
RgbaFp162264-bit RGBA
Rgba10101024332-bit RGBA