From c55b4a1ef071401cffd28ca51439dba0c2e86da0 Mon Sep 17 00:00:00 2001
From: Bharatt Kukreja
Date: Tue, 13 Jun 2023 21:32:39 +0000
Subject: Camera: Create links to mandatory stream combinations
Create links in Camera device to be used elsewhere to refer to the
mandatory stream combinations.
Bug: 271143048
Test: Documentation change
Change-Id: I9b64bbd5d5c1878a550e704acdca1e74a822ae07
---
.../hardware/camera2/CameraCharacteristics.java | 48 ++++++++++------------
.../android/hardware/camera2/CameraDevice.java | 42 +++++++++++++------
.../android/hardware/camera2/CameraMetadata.java | 24 +++++++----
3 files changed, 67 insertions(+), 47 deletions(-)
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index 48b5cac2a519..d352be16ae0c 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -3202,8 +3202,9 @@ public final class CameraCharacteristics extends CameraMetadata
- * Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
- * stream configurations on a per-capability basis.
+ * Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and
+ * {@link android.hardware.camera2.CameraDevice#legacy-level-guaranteed-configurations }
+ * for additional mandatory stream configurations on a per-capability basis.
* *1: For JPEG format, the sizes may be restricted by below conditions:
*
* - The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
@@ -3321,12 +3322,11 @@ public final class CameraCharacteristics extends CameraMetadata
+ * {@link android.hardware.camera2.CameraDevice#legacy-level-guaranteed-configurations tables}.
* The array of
* {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
* generated according to the documented
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} based on
- * specific device level and capabilities.
+ * {@link android.hardware.camera2.CameraDevice#legacy-level-guaranteed-configurations guideline} based on specific device level and capabilities.
* Clients can use the array as a quick reference to find an appropriate camera stream
* combination.
* As per documentation, the stream combinations with given PREVIEW, RECORD and
@@ -3355,12 +3355,11 @@ public final class CameraCharacteristics extends CameraMetadataAn array of mandatory concurrent stream combinations.
* This is an app-readable conversion of the concurrent mandatory stream combination
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession tables}.
+ * {@link android.hardware.camera2.CameraDevice#concurrent-stream-guaranteed-configurations tables}.
* The array of
* {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
* generated according to the documented
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for each
- * device which has its Id present in the set returned by
+ * {@link android.hardware.camera2.CameraDevice#concurrent-stream-guaranteed-configurations guideline} for each device which has its Id present in the set returned by
* {@link android.hardware.camera2.CameraManager#getConcurrentCameraIds }.
* Clients can use the array as a quick reference to find an appropriate camera stream
* combination.
@@ -3465,7 +3464,8 @@ public final class CameraCharacteristics extends CameraMetadataIf a camera device supports multi-resolution output streams for a particular format, for
* each of its mandatory stream combinations, the camera device will support using a
* MultiResolutionImageReader for the MAXIMUM stream of supported formats. Refer to
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional details.
+ * {@link android.hardware.camera2.CameraDevice#legacy-level-additional-guaranteed-combinations-with-multiresolutionoutputs }
+ * for additional details.
* To use multi-resolution input streams, the supported formats can be queried by {@link android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getInputFormats }.
* A reprocessable CameraCaptureSession can then be created using an {@link android.hardware.camera2.params.InputConfiguration InputConfiguration} constructed with
* the input MultiResolutionStreamInfo group, queried by {@link android.hardware.camera2.params.MultiResolutionStreamConfigurationMap#getInputInfo }.
@@ -3473,8 +3473,8 @@ public final class CameraCharacteristics extends CameraMetadata
+ * {@link android.hardware.camera2.CameraDevice#legacy-level-additional-guaranteed-combinations-with-multiresolutionoutputs }}
+ * for details about the additional mandatory stream combinations in this case.
* Optional - The value for this key may be {@code null} on some devices.
*/
@PublicKey
@@ -3586,12 +3586,11 @@ public final class CameraCharacteristics extends CameraMetadata
+ * {@link android.hardware.camera2.CameraDevice#additional-guaranteed-combinations-for-ultra-high-resolution-sensors tables}.
* The array of
* {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
* generated according to the documented
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for each
- * device which has the
+ * {@link android.hardware.camera2.CameraDevice#additional-guaranteed-combinations-for-ultra-high-resolution-sensors guideline} for each device which has the
* {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR }
* capability.
* Clients can use the array as a quick reference to find an appropriate camera stream
@@ -3614,12 +3613,11 @@ public final class CameraCharacteristics extends CameraMetadata
+ * {@link android.hardware.camera2.CameraDevice#10-bit-output-additional-guaranteed-configurations tables}.
* The array of
* {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
* generated according to the documented
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for each
- * device which has the
+ * {@link android.hardware.camera2.CameraDevice#10-bit-output-additional-guaranteed-configurations guideline} for each device which has the
* {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT }
* capability.
* Clients can use the array as a quick reference to find an appropriate camera stream
@@ -3639,12 +3637,12 @@ public final class CameraCharacteristics extends CameraMetadataAn array of mandatory stream combinations which are applicable when device lists
* {@code PREVIEW_STABILIZATION} in {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes}.
* This is an app-readable conversion of the preview stabilization mandatory stream
- * combination {@link android.hardware.camera2.CameraDevice#createCaptureSession tables}.
+ * combination
+ * {@link android.hardware.camera2.CameraDevice#preview-stabilization-guaranteed-stream-configurations tables}.
* The array of
* {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
* generated according to the documented
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for each
- * device which supports {@code PREVIEW_STABILIZATION}
+ * {@link android.hardware.camera2.CameraDevice#preview-stabilization-guaranteed-stream-configurations guideline} for each device which supports {@code PREVIEW_STABILIZATION}
* Clients can use the array as a quick reference to find an appropriate camera stream
* combination.
* The mandatory stream combination array will be {@code null} in case the device does not
@@ -3717,8 +3715,8 @@ public final class CameraCharacteristics extends CameraMetadataThe guaranteed stream combinations related to stream use case for a camera device with
* {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE }
* capability is documented in the camera device
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline}. The
- * application is strongly recommended to use one of the guaranteed stream combinations.
+ * {@link android.hardware.camera2.CameraDevice#stream-use-case-capability-additional-guaranteed-configurations guideline}. The application is strongly recommended to use one of the guaranteed stream
+ * combinations.
* If the application creates a session with a stream combination not in the guaranteed
* list, or with mixed DEFAULT and non-DEFAULT use cases within the same session,
* the camera device may ignore some stream use cases due to hardware constraints
@@ -3754,13 +3752,11 @@ public final class CameraCharacteristics extends CameraMetadataAn array of mandatory stream combinations with stream use cases.
* This is an app-readable conversion of the mandatory stream combination
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession tables} with
- * each stream's use case being set.
+ * {@link android.hardware.camera2.CameraDevice#stream-use-case-capability-additional-guaranteed-configurations tables} with each stream's use case being set.
* The array of
* {@link android.hardware.camera2.params.MandatoryStreamCombination combinations} is
* generated according to the documented
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession guideline} for a
- * camera device with
+ * {@link android.hardware.camera2.CameraDevice#stream-use-case-capability-additional-guaranteed-configurations guideline} for a camera device with
* {@link android.hardware.camera2.CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE }
* capability.
* The mandatory stream combination array will be {@code null} in case the device doesn't
diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java
index ad68866571e3..99b297abe92a 100644
--- a/core/java/android/hardware/camera2/CameraDevice.java
+++ b/core/java/android/hardware/camera2/CameraDevice.java
@@ -636,8 +636,9 @@ public abstract class CameraDevice implements AutoCloseable {
* {@code == }{@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}) support at
* least the following stream combinations:
*
+ *
LEGACY-level guaranteed configurations
+ *
*
- * | LEGACY-level guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Type | Max size | Type | Max size |
* | {@code PRIV} | {@code MAXIMUM} | | | Simple preview, GPU video processing, or no-preview video recording. |
@@ -656,8 +657,9 @@ public abstract class CameraDevice implements AutoCloseable {
* support at least the following stream combinations in addition to those for
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY} devices:
*
+ * LIMITED-level additional guaranteed configurations
+ *
*
- * | LIMITED-level additional guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Type | Max size | Type | Max size |
* | {@code PRIV} | {@code PREVIEW} | {@code PRIV} | {@code RECORD } | | High-resolution video recording with preview. |
@@ -674,8 +676,9 @@ public abstract class CameraDevice implements AutoCloseable {
* support at least the following stream combinations in addition to those for
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices:
*
+ * FULL-level additional guaranteed configurations
+ *
*
- * | FULL-level additional guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Type | Max size | Type | Max size |
* | {@code PRIV} | {@code PREVIEW} | {@code PRIV} | {@code MAXIMUM} | | Maximum-resolution GPU processing with preview. |
@@ -693,8 +696,9 @@ public abstract class CameraDevice implements AutoCloseable {
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL} and
* {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices:
*
+ * RAW-capability additional guaranteed configurations
+ *
*
- * | RAW-capability additional guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Type | Max size | Type | Max size |
* | {@code RAW } | {@code MAXIMUM} | | | No-preview DNG capture. |
@@ -716,8 +720,9 @@ public abstract class CameraDevice implements AutoCloseable {
* list for FULL-level devices, so this table is only relevant for LIMITED-level devices that
* support the BURST_CAPTURE capability.
*
+ * BURST-capability additional guaranteed configurations
+ *
*
- * | BURST-capability additional guaranteed configurations |
* | Target 1 | Target 2 | Sample use case(s) |
* | Type | Max size | Type | Max size |
* | {@code PRIV} | {@code PREVIEW} | {@code PRIV} | {@code MAXIMUM} | Maximum-resolution GPU processing with preview. |
@@ -733,8 +738,9 @@ public abstract class CameraDevice implements AutoCloseable {
* RAW capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES} includes
* {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}):
*
+ * LEVEL-3 additional guaranteed configurations
+ *
*
- * | LEVEL-3 additional guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Target 4 | Sample use case(s) |
* | Type | Max size | Type | Max size | Type | Max size | Type | Max size |
* | {@code PRIV} | {@code PREVIEW} | {@code PRIV} | {@code 640x480} | {@code YUV} | {@code MAXIMUM} | {@code RAW} | {@code MAXIMUM} | In-app viewfinder analysis with dynamic selection of output format. |
@@ -748,8 +754,9 @@ public abstract class CameraDevice implements AutoCloseable {
* Note: The sizes mentioned for these concurrent streams are the maximum sizes guaranteed
* to be supported. Sizes smaller than these, obtained by {@link StreamConfigurationMap#getOutputSizes} for a particular format, are supported as well.
*
+ * Concurrent stream guaranteed configurations
+ *
*
- * | Concurrent stream guaranteed configurations |
* | Target 1 | Target 2 | Sample use case(s) |
* | Type | Max size | Type | Max size |
* | {@code YUV} | {@code s1440p} | | In-app video / image processing. |
@@ -794,8 +801,9 @@ public abstract class CameraDevice implements AutoCloseable {
* stream combinations ({@code MULTI_RES} in the Max size column refers to a {@link
* MultiResolutionImageReader} created based on the variable max resolutions supported):
*
+ * LEGACY-level additional guaranteed combinations with MultiResolutionoutputs
+ *
*
- * | LEGACY-level additional guaranteed combinations with MultiResolutionoutputs |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Type | Max size | Type | Max size |
* | {@code PRIV} | {@code MULTI_RES} | | | Simple preview, GPU video processing, or no-preview video recording. |
@@ -814,8 +822,10 @@ public abstract class CameraDevice implements AutoCloseable {
*
* Devices with the ULTRA_HIGH_RESOLUTION_SENSOR capability have some additional guarantees
* which clients can take advantage of :
+ *
+ * Additional guaranteed combinations for ULTRA_HIGH_RESOLUTION sensors
+ *
*
- * | Additional guaranteed combinations for ULTRA_HIGH_RESOLUTION sensors |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | SC Map | Max size | Type | SC Map | Max size | Type | SC Map | Max size |
* | {@code YUV / JPEG / RAW} | {@code MAX_RES} | {@code MAX} | {@code PRIV / YUV} | {@code DEFAULT} | {@code PREVIEW} | | Ultra high res still image capture with preview |
@@ -834,8 +844,10 @@ public abstract class CameraDevice implements AutoCloseable {
* 10-bit output capable
* {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT}
* devices support at least the following stream combinations:
+ *
+ * 10-bit output additional guaranteed configurations
+ *
*
- * | 10-bit output additional guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Type | Max size | Type | Max size |
* | {@code PRIV} | {@code MAXIMUM} | } | Simple preview, GPU video processing, or no-preview video recording. |
@@ -887,8 +899,9 @@ public abstract class CameraDevice implements AutoCloseable {
* CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE}) support below additional
* stream combinations:
*
+ * STREAM_USE_CASE capability additional guaranteed configurations
+ *
*
- * | STREAM_USE_CASE capability additional guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Usecase | Type | Max size | Usecase | Type | Max size | Usecase |
* | {@code YUV / PRIV} | {@code PREVIEW} | {@code PREVIEW} | | | Simple preview or in-app image processing |
@@ -911,8 +924,9 @@ public abstract class CameraDevice implements AutoCloseable {
* stream use-case in {@link CameraCharacteristics#SCALER_AVAILABLE_STREAM_USE_CASES},
* support the additional stream combinations below:
*
+ * STREAM_USE_CASE_CROPPED_RAW capability additional guaranteed configurations
+ *
*
- * | STREAM_USE_CASE_CROPPED_RAW capability additional guaranteed configurations |
* | Target 1 | Target 2 | Target 3 | Sample use case(s) |
* | Type | Max size | Usecase | Type | Max size | Usecase | Type | Max size | Usecase |
* | {@code RAW} | {@code MAXIMUM} | {@code CROPPED_RAW} | | | Cropped RAW still capture without preview |
@@ -926,8 +940,10 @@ public abstract class CameraDevice implements AutoCloseable {
* the following stream combinations are guaranteed,
* for CaptureRequests where {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE} is set to
* {@link CameraMetadata#CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION}
+ *
+ *
Preview stabilization guaranteed stream configurations
+ *
*
- * | Preview stabilization guaranteed stream configurations |
* | Target 1 | Target 2 | Sample use case(s) |
* | Type | Max size | Type | Max size |
* | {@code PRIV / YUV} | {@code s1440p} | | Stabilized preview, GPU video processing, or no-preview stabilized video recording. |
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 4950373449e2..dfc27caa362c 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -1213,7 +1213,8 @@ public abstract class CameraMetadata {
*
* - Profile {@link android.hardware.camera2.params.DynamicRangeProfiles#HLG10 }
* - All mandatory stream combinations for this specific capability as per
- * documentation {@link android.hardware.camera2.CameraDevice#createCaptureSession }
+ * documentation
+ * {@link android.hardware.camera2.CameraDevice#10-bit-output-additional-guaranteed-configurations }
* - In case the device is not able to capture some combination of supported
* standard 8-bit and/or 10-bit dynamic range profiles within the same capture request,
* then those constraints must be listed in
@@ -1252,9 +1253,10 @@ public abstract class CameraMetadata {
*
* {@link android.hardware.camera2.CameraCharacteristics#SCALER_AVAILABLE_STREAM_USE_CASES }
* lists all of the supported stream use cases.
- * Refer to {@link android.hardware.camera2.CameraDevice#createCaptureSession } for the
- * mandatory stream combinations involving stream use cases, which can also be queried
- * via {@link android.hardware.camera2.params.MandatoryStreamCombination }.
+ * Refer to
+ * {@link android.hardware.camera2.CameraDevice#stream-use-case-capability-additional-guaranteed-configurations }
+ * for the mandatory stream combinations involving stream use cases, which can also be
+ * queried via {@link android.hardware.camera2.params.MandatoryStreamCombination }.
* @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
*/
public static final int REQUEST_AVAILABLE_CAPABILITIES_STREAM_USE_CASE = 19;
@@ -1752,7 +1754,8 @@ public abstract class CameraMetadata {
* This camera device does not have enough capabilities to qualify as a FULL device or
* better.
* Only the stream configurations listed in the LEGACY and LIMITED tables in the
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession} documentation are guaranteed to be supported.
+ * {@link android.hardware.camera2.CameraDevice#limited-level-additional-guaranteed-configurations }
+ * documentation are guaranteed to be supported.
* All LIMITED devices support the BACKWARDS_COMPATIBLE capability, indicating basic
* support for color image capture. The only exception is that the device may
* alternatively support only the DEPTH_OUTPUT capability, if it can only output depth
@@ -1779,7 +1782,8 @@ public abstract class CameraMetadata {
/**
* This camera device is capable of supporting advanced imaging applications.
* The stream configurations listed in the FULL, LEGACY and LIMITED tables in the
- * {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession} documentation are guaranteed to be supported.
+ * {@link android.hardware.camera2.CameraDevice#full-level-additional-guaranteed-configurations }
+ * documentation are guaranteed to be supported.
* A FULL device will support below capabilities:
*
* BURST_CAPTURE capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
@@ -1807,7 +1811,9 @@ public abstract class CameraMetadata {
/**
* This camera device is running in backward compatibility mode.
- * Only the stream configurations listed in the LEGACY table in the {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession} documentation are supported.
+ * Only the stream configurations listed in the LEGACY table in the
+ * {@link android.hardware.camera2.CameraDevice#legacy-level-guaranteed-configurations }
+ * documentation are supported.
* A LEGACY device does not support per-frame control, manual sensor control, manual
* post-processing, arbitrary cropping regions, and has relaxed performance constraints.
* No additional capabilities beyond BACKWARD_COMPATIBLE will ever be listed by a
@@ -1830,7 +1836,9 @@ public abstract class CameraMetadata {
* This camera device is capable of YUV reprocessing and RAW data capture, in addition to
* FULL-level capabilities.
* The stream configurations listed in the LEVEL_3, RAW, FULL, LEGACY and
- * LIMITED tables in the {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession} documentation are guaranteed to be supported.
+ * LIMITED tables in the
+ * {@link android.hardware.camera2.CameraDevice#level-3-additional-guaranteed-configurations }
+ * documentation are guaranteed to be supported.
* The following additional capabilities are guaranteed to be supported:
*
* YUV_REPROCESSING capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
--
cgit v1.2.3-59-g8ed1b