Camera2CaptureRequestBuilder

open class Camera2CaptureRequestBuilder
kotlin.Any
   ↳ androidx.camera.camera2.impl.Camera2CaptureRequestBuilder

This class is used to build a camera2 CaptureRequest from a CaptureConfig

Summary

Public constructors

This class is used to build a camera2 CaptureRequest from a CaptureConfig

Public methods

open static CaptureRequest?
build(@NonNull captureConfig: CaptureConfig, @Nullable device: CameraDevice?, @NonNull configuredSurfaceMap: MutableMap<DeferrableSurface!, Surface!>)

Builds a CaptureRequest from a CaptureConfig and a CameraDevice.

open static CaptureRequest?
buildWithoutTarget(@NonNull captureConfig: CaptureConfig, @Nullable device: CameraDevice?)

Return a CaptureRequest which include capture request parameters and desired template type, but no target surfaces and tag.

Public constructors

<init>

Camera2CaptureRequestBuilder()

This class is used to build a camera2 CaptureRequest from a CaptureConfig

Public methods

build

@Nullable open static fun build(@NonNull captureConfig: CaptureConfig, @Nullable device: CameraDevice?, @NonNull configuredSurfaceMap: MutableMap<DeferrableSurface!, Surface!>): CaptureRequest?

Builds a CaptureRequest from a CaptureConfig and a CameraDevice.

It uses configuredSurfaceMap to get the target surfaces from a DeferrableSurface.

Parameters
captureConfig CaptureConfig: which CaptureConfig to build CaptureRequest
device CaptureConfig: CameraDevice to create the CaptureRequest
configuredSurfaceMap CaptureConfig: A map of DeferrableSurface to Surface

buildWithoutTarget

@Nullable open static fun buildWithoutTarget(@NonNull captureConfig: CaptureConfig, @Nullable device: CameraDevice?): CaptureRequest?

Return a CaptureRequest which include capture request parameters and desired template type, but no target surfaces and tag.

Returns null if a valid CaptureRequest can not be constructed.