Table of Contents

Class ContinuousCaptureSession

A wrapper for a native Camera2 CaptureSession and ImageReader.

public class ContinuousCaptureSession : MonoBehaviour
Inheritance
object
ContinuousCaptureSession
Derived

Remarks

This is different from OnDemandCaptureSession as it returns a continuous stream of images.

Fields

OnSessionConfigurationFailed

Called when the session could not be configured.

public UnityEvent<string> OnSessionConfigurationFailed

Field Value

UnityEvent<string>

OnSessionConfigured

Called when the session has been configured.

public UnityEvent OnSessionConfigured

Field Value

UnityEvent

OnSessionRequestFailed

Called when the session request could not be set.

public UnityEvent<string> OnSessionRequestFailed

Field Value

UnityEvent<string>

OnSessionRequestSet

Called when the session request has been set.

public UnityEvent OnSessionRequestSet

Field Value

UnityEvent

_captureSession

The native capture session object.

protected AndroidJavaObject _captureSession

Field Value

AndroidJavaObject

Properties

CurrentState

The current assumed state of the native CaptureSession wrapper.

public NativeWrapperState CurrentState { get; }

Property Value

NativeWrapperState

IsActiveAndUsable

Is the native CaptureSession wrapper active and usable?

public bool IsActiveAndUsable { get; }

Property Value

bool

Methods

OnDestroy()

protected virtual void OnDestroy()

Release()

Releases the CaptureSession's native resources, and makes it unusable.

public void Release()

WaitForInitialization()

Waits until the CaptureSession is open or erred out.

public IEnumerator WaitForInitialization()

Returns

IEnumerator

WaitForInitializationAsync()

Waits until the CaptureSession is open or erred out.

public Awaitable<NativeWrapperState> WaitForInitializationAsync()

Returns

Awaitable<NativeWrapperState>

The current state of the CaptureSession.

Remarks

Requires Unity 6.0 or higher.

_onSessionConfigurationFailed(string)

public void _onSessionConfigurationFailed(string reason)

Parameters

reason string

_onSessionConfigured(string)

public void _onSessionConfigured(string _)

Parameters

_ string

_onSessionRequestFailed(string)

public void _onSessionRequestFailed(string reason)

Parameters

reason string

_onSessionRequestSet(string)

public void _onSessionRequestSet(string _)

Parameters

_ string