Extender

class Extender
kotlin.Any
   ↳ androidx.camera.camera2.Camera2Config.Extender

Extends a Config.ExtendableBuilder to add Camera2 options.

Summary

Public constructors

Creates an Extender that can be used to add Camera2 options to another Builder.

Public methods

Camera2Config.Extender!
setCameraEventCallback(cameraEventCallbacks: CameraEventCallbacks!)

Sets a CameraEventCallbacks instance.

Camera2Config.Extender!
setCaptureRequestOption(key: Key<ValueT>!, value: ValueT)

Sets a CaptureRequest.Key and Value on the configuration.

Camera2Config.Extender!

Sets a CameraDevice.StateCallback.

Camera2Config.Extender!

Sets a CameraCaptureSession.CaptureCallback.

Camera2Config.Extender!

Sets a CameraCaptureSession.StateCallback.

Public constructors

<init>

Extender(baseBuilder: Config.ExtendableBuilder!)

Creates an Extender that can be used to add Camera2 options to another Builder.

Parameters
baseBuilder Config.ExtendableBuilder!: The builder being extended.

Public methods

setCameraEventCallback

fun setCameraEventCallback(cameraEventCallbacks: CameraEventCallbacks!): Camera2Config.Extender!

Sets a CameraEventCallbacks instance.

Parameters
cameraEventCallbacks CameraEventCallbacks!: The CameraEventCallbacks.
Return
Camera2Config.Extender!: The current Extender.

setCaptureRequestOption

fun <ValueT : Any!> setCaptureRequestOption(key: Key<ValueT>!, value: ValueT): Camera2Config.Extender!

Sets a CaptureRequest.Key and Value on the configuration.

Parameters
key Key<ValueT>!: The CaptureRequest.Key which will be set.
value Key<ValueT>!: The value for the key.
<ValueT> Key<ValueT>!: The type of the value.
Return
Camera2Config.Extender!: The current Extender.

setDeviceStateCallback

fun setDeviceStateCallback(stateCallback: StateCallback!): Camera2Config.Extender!

Sets a CameraDevice.StateCallback.

The caller is expected to use the CameraDevice instance accessed through the callback methods responsibly. Generally safe usages include: (1) querying the device for its id, (2) using the callbacks to determine what state the device is currently in. Generally unsafe usages include: (1) creating a new CameraCaptureSession, (2) creating a new CaptureRequest, (3) closing the device. When the caller uses the device beyond the safe usage limits, the usage may still work in conjunction with CameraX, but any strong guarantees provided by CameraX about the validity of the camera state become void.

Parameters
stateCallback StateCallback!: The CameraDevice.StateCallback.
Return
Camera2Config.Extender!: The current Extender.

setSessionCaptureCallback

fun setSessionCaptureCallback(captureCallback: CaptureCallback!): Camera2Config.Extender!

Sets a CameraCaptureSession.CaptureCallback.

The caller is expected to use the CameraCaptureSession instance accessed through the callback methods responsibly. Generally safe usages include: (1) querying the session for its properties. Generally unsafe usages include: (1) submitting a new , (2) stopping an existing CaptureRequest, (3) closing the session, (4) attaching a new Surface to the session. When the caller uses the session beyond the safe usage limits, the usage may still work in conjunction with CameraX, but any strong gurantees provided by CameraX about the validity of the camera state become void.

The caller is generally free to use the CaptureRequest and instances accessed through the callback methods.

Parameters
captureCallback CaptureCallback!: The CameraCaptureSession.CaptureCallback.
Return
Camera2Config.Extender!: The current Extender.

setSessionStateCallback

fun setSessionStateCallback(stateCallback: StateCallback!): Camera2Config.Extender!

Sets a CameraCaptureSession.StateCallback.

The caller is expected to use the CameraCaptureSession instance accessed through the callback methods responsibly. Generally safe usages include: (1) querying the session for its properties, (2) using the callbacks to determine what state the session is currently in. Generally unsafe usages include: (1) submitting a new , (2) stopping an existing CaptureRequest, (3) closing the session, (4) attaching a new Surface to the session. When the caller uses the session beyond the safe usage limits, the usage may still work in conjunction with CameraX, but any strong gurantees provided by CameraX about the validity of the camera state become void.

Parameters
stateCallback StateCallback!: The CameraCaptureSession.StateCallback.
Return
Camera2Config.Extender!: The current Extender.