Camera2Config

class Camera2Config : Config
kotlin.Any
   ↳ androidx.camera.camera2.Camera2Config

Configuration options related to the android.hardware.camera2 APIs.

Summary

Nested classes

Extends a Config.ExtendableBuilder to add Camera2 options.

Public constructors

<init>(config: Config!)

Creates a Camera2Config for reading Camera2 options from the given config.

Public methods

CameraEventCallbacks!
getCameraEventCallback(valueIfMissing: CameraEventCallbacks!)

Returns the stored CameraEventCallbacks instance.

ValueT
getCaptureRequestOption(key: Key<ValueT>!, @Nullable valueIfMissing: ValueT?)

Returns a value for the given CaptureRequest.Key.

StateCallback!

Returns the stored CameraDevice.StateCallback.

CaptureCallback!

Returns the stored CameraCaptureSession.CaptureCallback.

StateCallback!

Returns the stored CameraCaptureSession.StateCallback.

Public constructors

<init>

Camera2Config(config: Config!)

Creates a Camera2Config for reading Camera2 options from the given config.

Parameters
config Config!: The config that potentially contains Camera2 options.

Public methods

getCameraEventCallback

fun getCameraEventCallback(valueIfMissing: CameraEventCallbacks!): CameraEventCallbacks!

Returns the stored CameraEventCallbacks instance.

Parameters
valueIfMissing CameraEventCallbacks!: The value to return if this configuration option has not been set.
Return
CameraEventCallbacks!: The stored value or valueIfMissing if the value does not exist in this configuration.

getCaptureRequestOption

fun <ValueT : Any!> getCaptureRequestOption(key: Key<ValueT>!, @Nullable valueIfMissing: ValueT?): ValueT

Returns a value for the given CaptureRequest.Key.

Parameters
key Key<ValueT>!: The key to retrieve.
valueIfMissing Key<ValueT>!: The value to return if this configuration option has not been set.
<ValueT> Key<ValueT>!: The type of the value.
Return
ValueT: The stored value or valueIfMissing if the value does not exist in this configuration.

getDeviceStateCallback

fun getDeviceStateCallback(valueIfMissing: StateCallback!): StateCallback!

Returns the stored CameraDevice.StateCallback.

Parameters
valueIfMissing StateCallback!: The value to return if this configuration option has not been set.
Return
StateCallback!: The stored value or valueIfMissing if the value does not exist in this configuration.

getSessionCaptureCallback

fun getSessionCaptureCallback(valueIfMissing: CaptureCallback!): CaptureCallback!

Returns the stored CameraCaptureSession.CaptureCallback.

Parameters
valueIfMissing CaptureCallback!: The value to return if this configuration option has not been set.
Return
CaptureCallback!: The stored value or valueIfMissing if the value does not exist in this configuration.

getSessionStateCallback

fun getSessionStateCallback(valueIfMissing: StateCallback!): StateCallback!

Returns the stored CameraCaptureSession.StateCallback.

Parameters
valueIfMissing StateCallback!: The value to return if this configuration option has not been set.
Return
StateCallback!: The stored value or valueIfMissing if the value does not exist in this configuration.