Table of Contents

Class STCaptureSessionNative

Class to interact with the native graphics plugin for SurfaceTexture rendering.

public static class STCaptureSessionNative
Inheritance
object
STCaptureSessionNative

Fields

NativeSetupCallbacksQueue

Event queues for renderer setup events, mapped to the IDs of the unity textures they are for.

public static readonly ConcurrentDictionary<uint, STCaptureSessionNative.NativeSetupCallbackType> NativeSetupCallbacksQueue

Field Value

ConcurrentDictionary<uint, STCaptureSessionNative.NativeSetupCallbackType>

NativeUpdateCallbacksQueue

Event queues for update events, mapped to the IDs of the native textures they are for.

public static readonly ConcurrentDictionary<uint, ConcurrentQueue<STCaptureSessionNative.AdditionalUpdateCallbackData>> NativeUpdateCallbacksQueue

Field Value

ConcurrentDictionary<uint, ConcurrentQueue<STCaptureSessionNative.AdditionalUpdateCallbackData>>

Methods

DeregisterNativeUpdateCallbacks(uint)

Deregisters a native update queue for a texture and disposes allocated data.

public static void DeregisterNativeUpdateCallbacks(uint textureId)

Parameters

textureId uint

The ID of the native texture to deregister updates of.

GetRenderEventFunction()

Gets the pointer to the native render event handler.

public static extern nint GetRenderEventFunction()

Returns

nint

NativeSetupCallback(bool, bool, uint, uint, bool)

The actual callback for native renderer setup events.

public static void NativeSetupCallback(bool glIsClean, bool sessionCallSent, uint unityTextureId, uint textureId, bool idIsValid)

Parameters

glIsClean bool

Was the GL context successfully cleaned up in this call?

sessionCallSent bool

Was the call to start the capture session sent to the Kotlin class?

unityTextureId uint

The unity texture associated with the event.

textureId uint

The native texture created by the call, may be invalid.

idIsValid bool

Is textureId a valid texture?

Remarks

This will dequeue from NativeSetupCallbacksQueue and process the callbacks.

NativeUpdateCallback(uint, bool)

The actual callback for native rendering updates.

public static void NativeUpdateCallback(uint textureId, bool success)

Parameters

textureId uint

The ID of the native texture which was updated.

success bool

If the operation was successful.

Remarks

This will dequeue from NativeUpdateCallbacksQueue and process the callback data.