Register now for Android Dev Summit 2019!

SessionConfigurationCompat

class SessionConfigurationCompat
kotlin.Any
   ↳ androidx.camera.camera2.impl.compat.params.SessionConfigurationCompat

Helper for accessing features in SessionConfiguration in a backwards compatible fashion.

Summary

Constants

static Int

A high speed session type that can only contain instances of OutputConfigurationCompat.

static Int

A regular session type containing instances of OutputConfigurationCompat running at regular non high speed FPS ranges and optionally InputConfigurationCompat for reprocessable sessions.

Public constructors

<init>(sessionType: Int, @NonNull outputsCompat: MutableList<OutputConfigurationCompat!>, @NonNull executor: Executor, @NonNull cb: StateCallback)

Create a new SessionConfigurationCompat.

Public methods

Boolean
equals(@Nullable other: Any?)

Executor!

Retrieve the Executor for the capture session.

InputConfigurationCompat!

Retrieve the InputConfigurationCompat.

MutableList<OutputConfigurationCompat!>!

Retrieve the OutputConfigurationCompat list for the capture session.

CaptureRequest!

Retrieve the session wide camera parameters (see CaptureRequest).

Int

Retrieve the type of the capture session.

StateCallback!

Retrieve the CameraCaptureSession.StateCallback for the capture session.

Unit

Sets the InputConfigurationCompat for a reprocessable session.

Unit

Sets the session wide camera parameters (see CaptureRequest).

Any?

Gets the underlying framework android.

static SessionConfigurationCompat?
wrap(@Nullable sessionConfiguration: Any?)

Creates an instance from a framework android.

Constants

SESSION_HIGH_SPEED

static val SESSION_HIGH_SPEED: Int

A high speed session type that can only contain instances of OutputConfigurationCompat. The outputs can run using high speed FPS ranges. Calls to setInputConfiguration are not supported.

Value: CameraDeviceCompat.SESSION_OPERATION_MODE_CONSTRAINED_HIGH_SPEED

SESSION_REGULAR

static val SESSION_REGULAR: Int

A regular session type containing instances of OutputConfigurationCompat running at regular non high speed FPS ranges and optionally InputConfigurationCompat for reprocessable sessions.

Value: CameraDeviceCompat.SESSION_OPERATION_MODE_NORMAL

Public constructors

<init>

SessionConfigurationCompat(sessionType: Int, @NonNull outputsCompat: MutableList<OutputConfigurationCompat!>, @NonNull executor: Executor, @NonNull cb: StateCallback)

Create a new SessionConfigurationCompat.

Parameters
sessionType Int: The session type.
outputsCompat Int: A list of output configurations for the capture session.
executor Int: The executor which should be used to invoke the callback. In general it is recommended that camera operations are not done on the main (UI) thread.
cb Int: A state callback interface implementation.

Public methods

equals

fun equals(@Nullable other: Any?): Boolean

getExecutor

fun getExecutor(): Executor!

Retrieve the Executor for the capture session.

Return
Executor!: The Executor on which the callback will be invoked.

getInputConfiguration

fun getInputConfiguration(): InputConfigurationCompat!

Retrieve the InputConfigurationCompat.

Return
InputConfigurationCompat!: The capture session input configuration.

getOutputConfigurations

fun getOutputConfigurations(): MutableList<OutputConfigurationCompat!>!

Retrieve the OutputConfigurationCompat list for the capture session.

Return
MutableList<OutputConfigurationCompat!>!: A list of output configurations for the capture session.

getSessionParameters

fun getSessionParameters(): CaptureRequest!

Retrieve the session wide camera parameters (see CaptureRequest).

Return
CaptureRequest!: A capture request that includes the initial values for any available session wide capture keys.

getSessionType

fun getSessionType(): Int

Retrieve the type of the capture session.

Return
Int: The capture session type.

getStateCallback

fun getStateCallback(): StateCallback!

Retrieve the CameraCaptureSession.StateCallback for the capture session.

Return
StateCallback!: A state callback interface implementation.

setInputConfiguration

fun setInputConfiguration(@NonNull input: InputConfigurationCompat): Unit

Sets the InputConfigurationCompat for a reprocessable session. Input configuration are not supported for SESSION_HIGH_SPEED.

Parameters
input InputConfigurationCompat: Input configuration.
Exceptions
UnsupportedOperationException In case it is called for SESSION_HIGH_SPEED type session configuration.

setSessionParameters

fun setSessionParameters(params: CaptureRequest!): Unit

Sets the session wide camera parameters (see CaptureRequest). This argument can be set for every supported session type and will be passed to the camera device as part of the capture session initialization. Session parameters are a subset of the available capture request parameters (see CameraCharacteristics.getAvailableSessionKeys) and their application can introduce internal camera delays. To improve camera performance it is suggested to change them sparingly within the lifetime of the capture session and to pass their initial values as part of this method.

Parameters
params CaptureRequest!: A capture request that includes the initial values for any available session wide capture keys. Tags (see CaptureRequest.Builder#setTag) and output targets (see CaptureRequest.Builder#addTarget) are ignored if set. Parameter values not part of CameraCharacteristics.getAvailableSessionKeys will also be ignored. It is recommended to build the session parameters using the same template type as the initial capture request, so that the session and initial request parameters match as much as possible.

unwrap

@Nullable fun unwrap(): Any?

Gets the underlying framework android.hardware.camera2.params.SessionConfiguration object.

This method always returns null on API <= 27.

Return
Any?: an equivalent android.hardware.camera2.params.SessionConfiguration object, or null if not supported.

wrap

@Nullable static fun wrap(@Nullable sessionConfiguration: Any?): SessionConfigurationCompat?

Creates an instance from a framework android.hardware.camera2.params.SessionConfiguration object.

This method always returns null on API <= 27.

Parameters
sessionConfiguration Any?: an android.hardware.camera2.params.SessionConfiguration object, or null if none.
Return
SessionConfigurationCompat?: an equivalent SessionConfigurationCompat object, or null if not supported.