public interface

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

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

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

Subclasses:

VideoCapture.Builder, Preview.Builder, ImageAnalysis.Builder, ImageCapture.Builder, VideoCapture.Builder<T>

Overview

Builder for a UseCase.

Summary

Methods
public UseCaseConfig<T>getUseCaseConfig()

Retrieves the configuration used by this builder.

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

Sets the Option Unpacker for translating this configuration into a CaptureConfig

public java.lang.ObjectsetCaptureType(UseCaseConfigFactory.CaptureType captureType)

Sets the capture type for this configuration.

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.ObjectsetHighResolutionDisabled(boolean disabled)

Sets high resolution disabled or not.

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.

public java.lang.ObjectsetZslDisabled(boolean disabled)

Sets zsl disabled or not.

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 java.lang.Object setZslDisabled(boolean disabled)

Sets zsl disabled or not.

Zsl will be disabled when any of the following conditions:

  • Extension is ON
  • Flash mode is ON or AUTO
  • VideoCapture is ON

Parameters:

disabled: True if zero-shutter lag should be disabled. Otherwise, should not be disabled. However, enabling zero-shutter lag needs other conditions e.g. flash mode OFF, so setting to false doesn't guarantee zero-shutter lag to be always ON.

public java.lang.Object setHighResolutionDisabled(boolean disabled)

Sets high resolution disabled or not.

High resolution will be disabled when Extension is ON.

Parameters:

disabled: True if high resolution should be disabled. Otherwise, should not be disabled.

public java.lang.Object setCaptureType(UseCaseConfigFactory.CaptureType captureType)

Sets the capture type for this configuration.

Parameters:

captureType: The capture type for this use case.

public UseCaseConfig<T> getUseCaseConfig()

Retrieves the configuration used by this builder.

Returns:

the configuration used by this builder.