NativeBindings
Public Methods
delegate void AcquireNextAvailableBufferDelegate
Delegate signature for the callback invoked by the native rendering plugin, requesting a new native buffer handle.
public delegate void AcquireNextAvailableBufferDelegate(
ref bool success,
ref ulong nativeBufferHandle,
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
ref bool | success | Whether a new native buffer handle was acquired |
ref ulong | nativeBufferHandle | Acquired native buffer handle |
IntPtr | context | User context passed during instance creation |
delegate void AcquireNextAvailableHwBufferDelegate
Delegate signature for the callback invoked by the native rendering plugin, requesting a new AHardwareBuffer.
public delegate void AcquireNextAvailableHwBufferDelegate(
ref bool success,
ref IntPtr hwBuffer,
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
ref bool | success | Whether a new native buffer handle was acquired |
ref IntPtr | hwBuffer | Acquired native buffer handle |
IntPtr | context | User context passed during instance creation |
delegate void GetFrameTransformMatrixDelegate
Delegate signature for the callback invoked by the native rendering plugin, requesting the frame transform matrix for the last acquired native buffer handle.
public delegate void GetFrameTransformMatrixDelegate(
ref bool success,
ref Native.MagicLeapNativeBindings.MLMat4f frameMat,
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
ref bool | success | Whether a valid frame transform matrix was provided |
ref Native.MagicLeapNativeBindings.MLMat4f | frameMat | Frame transform matrix |
IntPtr | context | User context passed during instance creation |
delegate void IsNewFrameAvailableDelegate
public delegate void IsNewFrameAvailableDelegate(
ref bool success,
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
ref bool | success | |
IntPtr | context |
MLResult.Code MLYcbcrRendererCreate
Create an instance of the YcbcrRenderer.
public MLResult.Code MLYcbcrRendererCreate(
ref CreateInfo createInfo,
out ulong handle
)
Parameters
Type | Name | Description |
---|---|---|
ref CreateInfo | createInfo | Info used to create the instance |
out ulong | handle | Handle to the instance |
Returns: MLResult.Code.Ok if instance was created successfully.
MLResult.Code.InvalidParam if one of params was null.
MLResult.Code.MediaGenericNoInit if func was called before Unity graphics was initialized.
IntPtr MLYcbcrRendererGetCallbackForPluginEvent
Get the callback function pointer to be used in CommandBuffer.IssuePluginEvent() for a given rendering plugin event.
public IntPtr MLYcbcrRendererGetCallbackForPluginEvent(
PluginEvent pluginEvent
)
Parameters
Type | Name | Description |
---|---|---|
PluginEvent | pluginEvent | Rendering plugin event to get the callback function pointer for |
Returns: Callback function pointer
int MLYcbcrRendererGetEventIdForPluginEvent
Get the event id to be used in CommandBuffer.IssuePluginEvent() for a given rendering plugin event.
public int MLYcbcrRendererGetEventIdForPluginEvent(
PluginEvent pluginEvent
)
Parameters
Type | Name | Description |
---|---|---|
PluginEvent | pluginEvent | Rendering plugin event to get the id for |
Returns: Event Id
delegate void OnCleanupCompleteDelegate
public delegate void OnCleanupCompleteDelegate(
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | context |
delegate void OnFirstFrameRenderedDelegate
public delegate void OnFirstFrameRenderedDelegate(
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | context |
delegate void OverrideYcbcrConversionSamplerDelegate
public delegate void OverrideYcbcrConversionSamplerDelegate(
ref VkAndroidHardwareBufferFormatPropertiesANDROID hwBufferFormatProperties,
ref bool samplerChanged,
ref VkSamplerYcbcrConversionCreateInfo sampler,
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
ref VkAndroidHardwareBufferFormatPropertiesANDROID | hwBufferFormatProperties | |
ref bool | samplerChanged | |
ref VkSamplerYcbcrConversionCreateInfo | sampler | |
IntPtr | context |
delegate void ReleaseBufferDelegate
Delegate signature for the callback invoked by the native rendering plugin, requesting the given native buffer to be released.
public delegate void ReleaseBufferDelegate(
ulong nativeBufferHandle,
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
ulong | nativeBufferHandle | Native buffer handle to be released |
IntPtr | context | User context passed during instance creation |
delegate void ReleaseHwBufferDelegate
Delegate signature for the callback invoked by the native rendering plugin, requesting the given AHardwareBuffer to be released.
public delegate void ReleaseHwBufferDelegate(
IntPtr hwBuffer,
IntPtr context
)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | nativeBufferHandle | Native buffer handle to be released |
IntPtr | context | User context passed during instance creation |
Public Enums
ColorSpace
Color spaces supported by the native rendering plugin
Enumerator | Value | Description |
---|---|---|
Linear | ||
Gamma |
PluginEvent
Plugin events supported by the native rendering plugin
Enumerator | Value | Description |
---|---|---|
SetTexture | Pass a unity texture and its width, height to the native rendering plugin | |
Draw | Draw the latest native buffer onto the unity texture | |
Cleanup | Destroy all resources and the renderer instance | |
AccessTexture |