TotalCaptureResult


public final class TotalCaptureResult
extends CaptureResult

java.lang.Object
   ↳ android.hardware.camera2.CameraMetadata<android.hardware.camera2.CaptureResult.Key<?>>
     ↳ android.hardware.camera2.CaptureResult
       ↳ android.hardware.camera2.TotalCaptureResult


The total assembled results of a single image capture from the image sensor.

Contains the final configuration for the capture hardware (sensor, lens, flash), the processing pipeline, the control algorithms, and the output buffers.

A TotalCaptureResult is produced by a CameraDevice after processing a CaptureRequest. All properties listed for capture requests can also be queried on the capture result, to determine the final values used for capture. The result also includes additional metadata about the state of the camera device during the capture.

All properties returned by CameraCharacteristics.getAvailableCaptureResultKeys() are available (that is CaptureResult.get will return non-null, if and only if that key that was enabled by the request. A few keys such as CaptureResult.STATISTICS_FACES are disabled by default unless enabled with a switch (such as CaptureRequest.STATISTICS_FACE_DETECT_MODE). Refer to each key documentation on a case-by-case basis.

For a logical multi-camera device, if the CaptureRequest contains a surface for an underlying physical camera, the corresponding TotalCaptureResult object will include the metadata for that physical camera. And the mapping between the physical camera id and result metadata can be accessed via getPhysicalCameraResults(). If all requested surfaces are for the logical camera, no metadata for physical camera will be included.

TotalCaptureResult objects are immutable.

Summary

Inherited constants

Inherited fields

Public methods

void close()

Releases the native memory that holds the metadata of this total capture result, along with the metadata of its partial results and physical camera results.

List<CaptureResult> getPartialResults()

Get the read-only list of partial results that compose this total result.

Map<String, CaptureResult> getPhysicalCameraResults()

This method was deprecated in API level 31.

Please use getPhysicalCameraTotalResults() instead to get the physical cameras' TotalCaptureResult.

Map<String, TotalCaptureResult> getPhysicalCameraTotalResults()

Get the map between physical camera ids and their total capture result metadata

This function can be called for logical multi-camera devices, which are devices that have REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability.

Inherited methods

Public methods

close

public void close ()

Releases the native memory that holds the metadata of this total capture result, along with the metadata of its partial results and physical camera results.

This method behaves like CaptureResult.close, and additionally closes the capture results returned by getPartialResults() and getPhysicalCameraTotalResults(). The list and the map returned by these methods, as well as the values of their capture results that are not part of the metadata, remain available.

The total capture results of the requests in a request list created by CameraConstrainedHighSpeedCaptureSession.createHighSpeedRequestList may share their partial results. Shared partial results are only closed once all the total capture results that share them are closed.

Calling this method more than once has no effect.

getPartialResults

public List<CaptureResult> getPartialResults ()

Get the read-only list of partial results that compose this total result.

The list is returned is unmodifiable; attempting to modify it will result in a UnsupportedOperationException being thrown.

The list size will be inclusive between 0 and CameraCharacteristics.REQUEST_PARTIAL_RESULT_COUNT, with elements in ascending order of when CameraCaptureSession.CaptureCallback.onCaptureProgressed was invoked.

Returns
List<CaptureResult> unmodifiable list of partial results.
This value cannot be null.

getPhysicalCameraResults


Deprecated in API level 31
public Map<String, CaptureResult> getPhysicalCameraResults ()

This method was deprecated in API level 31.

Please use getPhysicalCameraTotalResults() instead to get the physical cameras' TotalCaptureResult.

Get the map between physical camera ids and their capture result metadata

This function can be called for logical multi-camera devices, which are devices that have REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability and calls to CameraCharacteristics.getPhysicalCameraIds return a non-empty set of physical devices that are backing the logical camera.

If one or more streams from the underlying physical cameras were requested by the corresponding capture request, this function returns the result metadata for those physical cameras. Otherwise, an empty map is returned.

Returns
Map<String, CaptureResult> unmodifiable map between physical camera ids and their capture result metadata

getPhysicalCameraTotalResults

public Map<String, TotalCaptureResult> getPhysicalCameraTotalResults ()

Get the map between physical camera ids and their total capture result metadata

This function can be called for logical multi-camera devices, which are devices that have REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA capability.

If one or more streams from the underlying physical cameras were requested by the corresponding capture request, this function returns the total result metadata for those physical cameras. Otherwise, an empty map is returned.

This function replaces the deprecated getPhysicalCameraResults(), and its return value is a map of TotalCaptureResult rather than CaptureResult.

To reprocess an image from a physical camera stream, typically returned from a MultiResolutionImageReader, the application must look up this map to get the TotalCaptureResult from the physical camera and pass it to CameraDevice.createReprocessCaptureRequest.

Returns
Map<String, TotalCaptureResult> unmodifiable map between physical camera ids and their total capture result metadata.
This value cannot be null.