public interface

UseCaseConfig.Builder<T extends UseCase, C extends UseCaseConfig, B>

implements TargetConfig.Builder<UseCase, java.lang.Object>, Config.ExtendableBuilder, UseCaseEventConfig.Builder<java.lang.Object>

 androidx.camera.core.UseCaseConfig.Builder<T, C, B>

Subclasses:

ImageAnalysisConfig.Builder, PreviewConfig.Builder, VideoCaptureConfig.Builder, ImageCaptureConfig.Builder

Overview

Builder for a UseCaseConfig.

Summary

Methods
public UseCaseConfig<T>build()

Builds the configuration for the target use case.

public java.lang.ObjectsetCaptureOptionUnpacker(CaptureConfig.OptionUnpacker optionUnpacker)

Sets the Option Unpacker for translating this configuration into a CaptureConfig

public java.lang.ObjectsetDefaultCaptureConfig(CaptureConfig captureConfig)

Sets the default capture configuration for this use case.

public java.lang.ObjectsetDefaultSessionConfig(SessionConfig sessionConfig)

Sets the default session configuration for this use case.

public java.lang.ObjectsetSessionOptionUnpacker(SessionConfig.OptionUnpacker optionUnpacker)

Sets the Option Unpacker for translating this configuration into a SessionConfig

public java.lang.ObjectsetSurfaceOccupancyPriority(int priority)

Sets the surface occupancy priority of the intended target from this configuration.

Methods

public java.lang.Object setDefaultSessionConfig(SessionConfig sessionConfig)

Sets the default session configuration for this use case.

Parameters:

sessionConfig: The default session configuration to use for this use case.

Returns:

the current Builder.

public java.lang.Object setDefaultCaptureConfig(CaptureConfig captureConfig)

Sets the default capture configuration for this use case.

Parameters:

captureConfig: The default capture configuration to use for this use case.

Returns:

the current Builder.

public java.lang.Object setSessionOptionUnpacker(SessionConfig.OptionUnpacker optionUnpacker)

Sets the Option Unpacker for translating this configuration into a SessionConfig

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

Parameters:

optionUnpacker: The option unpacker for to use for this use case.

Returns:

the current Builder.

public java.lang.Object setCaptureOptionUnpacker(CaptureConfig.OptionUnpacker optionUnpacker)

Sets the Option Unpacker for translating this configuration into a CaptureConfig

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

Parameters:

optionUnpacker: The option unpacker for to use for this use case.

Returns:

the current Builder.

public java.lang.Object setSurfaceOccupancyPriority(int priority)

Sets the surface occupancy priority of the intended target from this configuration.

The stream resource of android.hardware.camera2.CameraDevice is limited. When one use case occupies a larger stream resource, it will impact the other use cases to get smaller stream resource. Use this to determine which use case can have higher priority to occupancy stream resource first.

Parameters:

priority: The priority to occupancy the available stream resource. Higher value will have higher priority.

Returns:

The current Builder.

public UseCaseConfig<T> build()

Builds the configuration for the target use case.