Camera2Interop.Extender

public static final class Camera2Interop.Extender
extends Object

java.lang.Object
   ↳ androidx.camera.camera2.interop.Camera2Interop.Extender<T>


Extends a ExtendableBuilder to add Camera2 options.

Summary

Public constructors

Camera2Interop.Extender(ExtendableBuilder<T> baseBuilder)

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

Public methods

<ValueT> Extender<T> setCaptureRequestOption(Key<ValueT> key, ValueT value)

Sets a CaptureRequest.Key and Value on the configuration.

Extender<T> setDeviceStateCallback(CameraDevice.StateCallback stateCallback)

Sets a CameraDevice.StateCallback.

Extender<T> setSessionCaptureCallback(CameraCaptureSession.CaptureCallback captureCallback)

Sets a CameraCaptureSession.CaptureCallback.

Extender<T> setSessionStateCallback(CameraCaptureSession.StateCallback stateCallback)

Sets a CameraCaptureSession.StateCallback.

Inherited methods

Public constructors

Camera2Interop.Extender

public Camera2Interop.Extender (ExtendableBuilder<T> baseBuilder)

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

Parameters
baseBuilder ExtendableBuilder: The builder being extended.

Public methods

setCaptureRequestOption

public Extender<T> setCaptureRequestOption (Key<ValueT> key, 
                ValueT value)

Sets a CaptureRequest.Key and Value on the configuration.

Parameters
key Key: The CaptureRequest.Key which will be set.

value ValueT: The value for the key.

Returns
Extender<T> The current Extender.

setDeviceStateCallback

public Extender<T> setDeviceStateCallback (CameraDevice.StateCallback stateCallback)

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 CameraDevice.StateCallback: The CameraDevice.StateCallback.

Returns
Extender<T> The current Extender.

setSessionCaptureCallback

public Extender<T> setSessionCaptureCallback (CameraCaptureSession.CaptureCallback captureCallback)

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 CaptureRequest, (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 guarantees provided by CameraX about the validity of the camera state become void.

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

Parameters
captureCallback CameraCaptureSession.CaptureCallback: The CameraCaptureSession.CaptureCallback.

Returns
Extender<T> The current Extender.

setSessionStateCallback

public Extender<T> setSessionStateCallback (CameraCaptureSession.StateCallback stateCallback)

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 CaptureRequest, (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 guarantees provided by CameraX about the validity of the camera state become void.

Parameters
stateCallback CameraCaptureSession.StateCallback: The CameraCaptureSession.StateCallback.

Returns
Extender<T> The current Extender.