MultiResolutionImageReader.Builder


public static final class MultiResolutionImageReader.Builder
extends Object

java.lang.Object
   ↳ android.hardware.camera2.MultiResolutionImageReader.Builder


Builder class for MultiResolutionImageReader objects.

Summary

Public constructors

Builder(Collection<MultiResolutionStreamInfo> streams, int format, int maxImages)

Constructs a new builder for MultiResolutionImageReader.

Public methods

MultiResolutionImageReader build()

Build a new MultiResolutionImageReader object.

MultiResolutionImageReader.Builder setConcurrentOutputsEnabled(boolean enable)

Turn on/off concurrent outputs for the internal ImageReaders.

MultiResolutionImageReader.Builder setUsage(long usage)

Set the intended ERROR(usage/android.hardware.HardwareBuffer.Usage usage) of the images produced by the internal ImageReaders.

Inherited methods

Public constructors

Builder

public Builder (Collection<MultiResolutionStreamInfo> streams, 
                int format, 
                int maxImages)

Constructs a new builder for MultiResolutionImageReader.

See MultiResolutionImageReader(Collection,int,int,long) for detailed explanations of the constructor parameters.

Parameters
streams Collection: The group of multi-resolution stream info returned from MultiResolutionStreamConfigurationMap.getOutputFormats().
This value cannot be null.

format int: The format of the Image that this multi-resolution reader will produce.
Value is one of the following:
maxImages int: The maximum number of images the user will want to access simultaneously.
Value is 1 or greater

Public methods

build

public MultiResolutionImageReader build ()

Build a new MultiResolutionImageReader object.

Returns
MultiResolutionImageReader The new MultiResolutionImageReader object.
This value cannot be null.

setConcurrentOutputsEnabled

public MultiResolutionImageReader.Builder setConcurrentOutputsEnabled (boolean enable)

Turn on/off concurrent outputs for the internal ImageReaders.

If ERROR(/MultiResolutionStreamConfigurationMap#isConcurrentReadersSupported) returns true, the camera device supports concurrent outputs from multiple internal ImageReaders (for example, in scenarios where multiple sensors run at the same time). By default, concurrent outputs are disabled. The application can enable such mode by calling this function with true.

Parameters
enable boolean: Whether to allow the camera device to output concurrent readers for this MultiResolutionImageReader. If set to true for a device that doesn't support MultiResolutionImageReader concurrency, CameraDevice.createCaptureSession(SessionConfiguration) will fail.

Returns
MultiResolutionImageReader.Builder the Builder instance with concurrency enabled.
This value cannot be null.

setUsage

public MultiResolutionImageReader.Builder setUsage (long usage)

Set the intended ERROR(usage/android.hardware.HardwareBuffer.Usage usage) of the images produced by the internal ImageReaders.

The default usage is HardwareBuffer.USAGE_CPU_READ_OFTEN, unless the format is ImageFormat.PRIVATE, in which case the default usage is 0.

Parameters
usage long: The intended ERROR(usage/android.hardware.HardwareBuffer.Usage usage) of the images produced by the internal ImageReaders.
Value is either 0 or a combination of the following:
Returns
MultiResolutionImageReader.Builder the Builder instance with customized usage value.
This value cannot be null.