Table of Contents

Class CaptureSessionBase<TProxy>

Base class for all capture session types.

public abstract class CaptureSessionBase<TProxy> : StatefulResource where TProxy : CaptureSessionBase<TProxy>.ProxyBase

Type Parameters

TProxy

The proxy type.

Inheritance
object
CaptureSessionBase<TProxy>
Derived
Inherited Members
Extension Methods

Constructors

CaptureSessionBase(TProxy, AndroidJavaObject)

protected CaptureSessionBase(TProxy proxy, AndroidJavaObject native)

Parameters

proxy TProxy
native AndroidJavaObject

Fields

NativeProxy

Native callback handler.

public readonly TProxy NativeProxy

Field Value

TProxy

_disposed

protected bool _disposed

Field Value

bool

_native

protected readonly AndroidJavaObject _native

Field Value

AndroidJavaObject

Methods

CloseWork()

protected ValueTask CloseWork()

Returns

ValueTask

DisposeAsync()

Closes the session (if not already closed) and releases native resources.

public virtual ValueTask DisposeAsync()

Returns

ValueTask

~CaptureSessionBase()

protected ~CaptureSessionBase()

ThrowIfDisposed()

protected override void ThrowIfDisposed()

TryAbortCaptures(out ErrorCode)

Discard all captures currently pending and in-progress as fast as possible.

public bool TryAbortCaptures(out CaptureSessionBase<TProxy>.ErrorCode errorCode)

Parameters

errorCode CaptureSessionBase<TProxy>.ErrorCode

Error code if the operation was unsuccessful.

Returns

bool

true if successful; false otherwise.

Remarks

This makes the session unusable for the future, so call DisposeAsync() afterwards.

Exceptions

ObjectDisposedException

Events

OnSessionClosed

Called when the session is closed.

public event Action? OnSessionClosed

Event Type

Action

OnSessionConfigurationFailed

Called when the session could not be configured.

public event Action<CaptureSessionBase<TProxy>.ErrorCode>? OnSessionConfigurationFailed

Event Type

Action<CaptureSessionBase<TProxy>.ErrorCode>

OnSessionConfigured

Called when the session has been configured.

public event Action? OnSessionConfigured

Event Type

Action

OnSessionRequestFailed

Called when the session request could not be set.

public event Action<CaptureSessionBase<TProxy>.ErrorCode>? OnSessionRequestFailed

Event Type

Action<CaptureSessionBase<TProxy>.ErrorCode>

OnSessionRequestSet

Called when the session request has been set.

public event Action? OnSessionRequestSet

Event Type

Action

OnSessionRequestSetWithId

Same as OnSessionRequestSet, but includes the sequence ID of the capture request.

public event Action<int>? OnSessionRequestSetWithId

Event Type

Action<int>