UseCaseConfig

@RequiresApi(21) interface UseCaseConfig<T : UseCase!> : TargetConfig<T>, UseCaseEventConfig, ImageInputConfig
androidx.camera.core.impl.UseCaseConfig

Configuration containing options for use cases.

Summary

Nested classes
abstract

Builder for a UseCase.

Public methods
open CameraSelector?
getCameraSelector(@Nullable valueIfMissing: CameraSelector?)

Retrieves the camera selector that this use case requires.

open CameraSelector

Retrieves the camera selector that this use case requires.

open CaptureConfig.OptionUnpacker?

Retrieves the CaptureConfig.OptionUnpacker for this use case.

open CaptureConfig.OptionUnpacker

Retrieves the CaptureConfig.OptionUnpacker for this use case.

open CaptureConfig?
getDefaultCaptureConfig(@Nullable valueIfMissing: CaptureConfig?)

Retrieves the default capture configuration for this use case.

open CaptureConfig

Retrieves the default capture configuration for this use case.

open SessionConfig?
getDefaultSessionConfig(@Nullable valueIfMissing: SessionConfig?)

Retrieves the default session configuration for this use case.

open SessionConfig

Retrieves the default session configuration for this use case.

open SessionConfig.OptionUnpacker?

Retrieves the SessionConfig.OptionUnpacker for this use case.

open SessionConfig.OptionUnpacker

Retrieves the SessionConfig.OptionUnpacker for this use case.

open Int

Retrieves the surface occupancy priority of the target intending to use from this configuration.

open Int

Retrieves the surface occupancy priority of the target intending to use from this configuration.

Inherited functions
Properties
static Config.Option<CameraSelector!>!

Option: camerax.

static Config.Option<CaptureConfig.OptionUnpacker!>!

Option: camerax.

static Config.Option<CaptureConfig!>!

Option: camerax.

static Config.Option<SessionConfig!>!

Option: camerax.

static Config.Option<SessionConfig.OptionUnpacker!>!

Option: camerax.

static Config.Option<Int!>!

Option: camerax.

Inherited properties

Public methods

getCameraSelector

@Nullable open fun getCameraSelector(@Nullable valueIfMissing: CameraSelector?): CameraSelector?

Retrieves the camera selector that this use case requires.

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

getCameraSelector

@NonNull open fun getCameraSelector(): CameraSelector

Retrieves the camera selector that this use case requires.

Return
CameraSelector The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getCaptureOptionUnpacker

@Nullable open fun getCaptureOptionUnpacker(@Nullable valueIfMissing: CaptureConfig.OptionUnpacker?): CaptureConfig.OptionUnpacker?

Retrieves the CaptureConfig.OptionUnpacker for this use case.

This unpacker is used to initialize the use case's capture configuration.

TODO(b/120949879): This may be removed when CaptureConfig removes all camera2 dependencies.

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

getCaptureOptionUnpacker

@NonNull open fun getCaptureOptionUnpacker(): CaptureConfig.OptionUnpacker

Retrieves the CaptureConfig.OptionUnpacker for this use case.

This unpacker is used to initialize the use case's capture configuration.

TODO(b/120949879): This may be removed when CaptureConfig removes all camera2 dependencies.

Return
CaptureConfig.OptionUnpacker The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getDefaultCaptureConfig

@Nullable open fun getDefaultCaptureConfig(@Nullable valueIfMissing: CaptureConfig?): CaptureConfig?

Retrieves the default capture configuration for this use case.

This configuration is used to initialize the use case's capture configuration with default values.

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

getDefaultCaptureConfig

@NonNull open fun getDefaultCaptureConfig(): CaptureConfig

Retrieves the default capture configuration for this use case.

This configuration is used to initialize the use case's capture configuration with default values.

Return
CaptureConfig The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getDefaultSessionConfig

@Nullable open fun getDefaultSessionConfig(@Nullable valueIfMissing: SessionConfig?): SessionConfig?

Retrieves the default session configuration for this use case.

This configuration is used to initialize the use case's session configuration with default values.

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

getDefaultSessionConfig

@NonNull open fun getDefaultSessionConfig(): SessionConfig

Retrieves the default session configuration for this use case.

This configuration is used to initialize the use case's session configuration with default values.

Return
SessionConfig The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getSessionOptionUnpacker

@Nullable open fun getSessionOptionUnpacker(@Nullable valueIfMissing: SessionConfig.OptionUnpacker?): SessionConfig.OptionUnpacker?

Retrieves the SessionConfig.OptionUnpacker for this use case.

This unpacker is used to initialize the use case's session configuration.

TODO(b/120949879): This may be removed when SessionConfig removes all camera2 dependencies.

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

getSessionOptionUnpacker

@NonNull open fun getSessionOptionUnpacker(): SessionConfig.OptionUnpacker

Retrieves the SessionConfig.OptionUnpacker for this use case.

This unpacker is used to initialize the use case's session configuration.

TODO(b/120949879): This may be removed when SessionConfig removes all camera2 dependencies.

Return
SessionConfig.OptionUnpacker The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

getSurfaceOccupancyPriority

open fun getSurfaceOccupancyPriority(valueIfMissing: Int): Int

Retrieves the surface occupancy priority of the target intending to use from this configuration.

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

getSurfaceOccupancyPriority

open fun getSurfaceOccupancyPriority(): Int

Retrieves the surface occupancy priority of the target intending to use from this configuration.

Return
Int The stored value, if it exists in this configuration.
Exceptions
IllegalArgumentException if the option does not exist in this configuration.

Properties

OPTION_CAMERA_SELECTOR

static val OPTION_CAMERA_SELECTOR: Config.Option<CameraSelector!>!

Option: camerax.core.useCase.cameraSelector

OPTION_CAPTURE_CONFIG_UNPACKER

static val OPTION_CAPTURE_CONFIG_UNPACKER: Config.Option<CaptureConfig.OptionUnpacker!>!

Option: camerax.core.useCase.captureConfigUnpacker

TODO(b/120949879): This may be removed when CaptureConfig removes all camera2 dependencies.

OPTION_DEFAULT_CAPTURE_CONFIG

static val OPTION_DEFAULT_CAPTURE_CONFIG: Config.Option<CaptureConfig!>!

Option: camerax.core.useCase.defaultCaptureConfig

OPTION_DEFAULT_SESSION_CONFIG

static val OPTION_DEFAULT_SESSION_CONFIG: Config.Option<SessionConfig!>!

Option: camerax.core.useCase.defaultSessionConfig

OPTION_SESSION_CONFIG_UNPACKER

static val OPTION_SESSION_CONFIG_UNPACKER: Config.Option<SessionConfig.OptionUnpacker!>!

Option: camerax.core.useCase.sessionConfigUnpacker

TODO(b/120949879): This may be removed when SessionConfig removes all camera2 dependencies.

OPTION_SURFACE_OCCUPANCY_PRIORITY

static val OPTION_SURFACE_OCCUPANCY_PRIORITY: Config.Option<Int!>!

Option: camerax.core.useCase.surfaceOccypyPriority