Camera2Config

public final class Camera2Config
extends Object implements Config

java.lang.Object
   ↳ androidx.camera.camera2.Camera2Config


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

Summary

Nested classes

class Camera2Config.Extender

Extends a Config.ExtendableBuilder to add Camera2 options. 

Public constructors

Camera2Config(Config config)

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

Public methods

CameraEventCallbacks getCameraEventCallback(CameraEventCallbacks valueIfMissing)

Returns the stored CameraEventCallbacks instance.

<ValueT> ValueT getCaptureRequestOption(Key<ValueT> key, ValueT valueIfMissing)

Returns a value for the given CaptureRequest.Key.

CameraDevice.StateCallback getDeviceStateCallback(CameraDevice.StateCallback valueIfMissing)

Returns the stored CameraDevice.StateCallback.

CameraCaptureSession.CaptureCallback getSessionCaptureCallback(CameraCaptureSession.CaptureCallback valueIfMissing)

Returns the stored CameraCaptureSession.CaptureCallback.

CameraCaptureSession.StateCallback getSessionStateCallback(CameraCaptureSession.StateCallback valueIfMissing)

Returns the stored CameraCaptureSession.StateCallback.

Inherited methods

Public constructors

Camera2Config

public 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

public CameraEventCallbacks getCameraEventCallback (CameraEventCallbacks valueIfMissing)

Returns the stored CameraEventCallbacks instance.

Parameters
valueIfMissing CameraEventCallbacks: The value to return if this configuration option has not been set.

Returns
CameraEventCallbacks The stored value or valueIfMissing if the value does not exist in this configuration.

getCaptureRequestOption

public ValueT getCaptureRequestOption (Key<ValueT> key, 
                ValueT valueIfMissing)

Returns a value for the given CaptureRequest.Key.

Parameters
key Key: The key to retrieve.

valueIfMissing ValueT: The value to return if this configuration option has not been set.

Returns
ValueT The stored value or valueIfMissing if the value does not exist in this configuration.

getDeviceStateCallback

public CameraDevice.StateCallback getDeviceStateCallback (CameraDevice.StateCallback valueIfMissing)

Returns the stored CameraDevice.StateCallback.

Parameters
valueIfMissing CameraDevice.StateCallback: The value to return if this configuration option has not been set.

Returns
CameraDevice.StateCallback The stored value or valueIfMissing if the value does not exist in this configuration.

getSessionCaptureCallback

public CameraCaptureSession.CaptureCallback getSessionCaptureCallback (CameraCaptureSession.CaptureCallback valueIfMissing)

Returns the stored CameraCaptureSession.CaptureCallback.

Parameters
valueIfMissing CameraCaptureSession.CaptureCallback: The value to return if this configuration option has not been set.

Returns
CameraCaptureSession.CaptureCallback The stored value or valueIfMissing if the value does not exist in this configuration.

getSessionStateCallback

public CameraCaptureSession.StateCallback getSessionStateCallback (CameraCaptureSession.StateCallback valueIfMissing)

Returns the stored CameraCaptureSession.StateCallback.

Parameters
valueIfMissing CameraCaptureSession.StateCallback: The value to return if this configuration option has not been set.

Returns
CameraCaptureSession.StateCallback The stored value or valueIfMissing if the value does not exist in this configuration.