From 126a7468c2b86f27779443f5f2578a03f3ad78e8 Mon Sep 17 00:00:00 2001
From: Eino-Ville Talvala
Date: Tue, 4 Nov 2014 16:31:01 -0800
Subject: [PATCH] Camera2: Add BURST_CAPTURE capability flag
This capability (a subset of FULL) indicates that a camera device
can capture high-rate (>= 20fps) bursts of images at full device
resolution, in at least the YUV_420_888 format.
It also guarantees that the synchronization latency for a device is
relatively small, so that fixed-setting bursts can be captured quickly.
Bug: 18281970
Change-Id: Ifc8fc43252a77097d804429d1c9f6fa71a95aa4f
---
api/current.txt | 1 +
.../camera2/CameraCharacteristics.java | 12 +++++++---
.../hardware/camera2/CameraDevice.java | 18 +++++++++++++++
.../hardware/camera2/CameraMetadata.java | 23 +++++++++++++++++--
4 files changed, 49 insertions(+), 5 deletions(-)
diff --git a/api/current.txt b/api/current.txt
index e812a8aeeebaa..46a09432d0e8f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -12821,6 +12821,7 @@ package android.hardware.camera2 {
field public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2; // 0x2
field public static final int NOISE_REDUCTION_MODE_OFF = 0; // 0x0
field public static final int REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0; // 0x0
+ field public static final int REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6; // 0x6
field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; // 0x2
field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1; // 0x1
field public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3; // 0x3
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index eec98b61e1509..754f27095d0f5 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -1156,6 +1156,7 @@ public final class CameraCharacteristics extends CameraMetadata{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}
* {@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}
* {@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}
+ * {@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}
*
* This key is available on all devices.
*
@@ -1165,6 +1166,7 @@ public final class CameraCharacteristics extends CameraMetadata REQUEST_AVAILABLE_CAPABILITIES =
@@ -2285,12 +2287,16 @@ public final class CameraCharacteristics extends CameraMetadataCamera devices will come in three flavors: LEGACY, LIMITED and FULL.
* A FULL device will support below capabilities:
*
- * - 30fps at maximum resolution (== sensor resolution) is preferred, more than 20fps is required.
+ * - 30fps operation at maximum resolution (== sensor resolution) is preferred, more than
+ * 20fps is required, for at least uncompressed YUV
+ * output. ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains BURST_CAPTURE)
* - Per frame control ({@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency}
== PER_FRAME_CONTROL)
* - Manual sensor control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR)
- * - Manual post-processing control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_POST_PROCESSING)
+ * - Manual post-processing control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
+ * MANUAL_POST_PROCESSING)
* - Arbitrary cropping region ({@link CameraCharacteristics#SCALER_CROPPING_TYPE android.scaler.croppingType}
== FREEFORM)
- * - At least 3 processed (but not stalling) format output streams ({@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_PROC android.request.maxNumOutputProc}
>= 3)
+ * - At least 3 processed (but not stalling) format output streams
+ * ({@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_PROC android.request.maxNumOutputProc}
>= 3)
* - The required stream configuration defined in android.scaler.availableStreamConfigurations
* - The required exposure time range defined in {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}
* - The required maxFrameDuration defined in {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}
diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java
index 0bb742c77f645..9e90d019f951e 100644
--- a/core/java/android/hardware/camera2/CameraDevice.java
+++ b/core/java/android/hardware/camera2/CameraDevice.java
@@ -334,6 +334,24 @@ public abstract class CameraDevice implements AutoCloseable {
*
*
*
+ * BURST-capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES} includes
+ * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}) devices
+ * support at least the below stream combinations in addition to those for
+ * {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices. Note that all
+ * FULL-level devices support the BURST capability, and the below list is a strict subset of the
+ * 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 |
+ * | 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. |
+ * | {@code PRIV} | {@code PREVIEW} | {@code YUV } | {@code MAXIMUM} | Maximum-resolution in-app processing with preview. |
+ * | {@code YUV } | {@code PREVIEW} | {@code YUV } | {@code MAXIMUM} | Maximum-resolution two-input in-app processsing. |
+ *
+ *
+ *
* Since the capabilities of camera devices vary greatly, a given camera device may support
* target combinations with sizes outside of these guarantees, but this can only be tested for
* by attempting to create a session with such targets.
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 67cd021bc6bbc..271fc309c82ac 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -482,6 +482,26 @@ public abstract class CameraMetadata {
*/
public static final int REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5;
+ /**
+ * The camera device supports capturing maximum-resolution
+ * images at >= 20 frames per second, in at least the
+ * uncompressed YUV format, when post-processing settings
+ * are set to FAST.
+ * More specifically, this means that a size matching the
+ * camera device's active array size is listed as a
+ * supported size for the YUV_420_888 format in
+ * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}, and the
+ * minimum frame duration for that format and size is <=
+ * 1/20 s.
+ * In addition, the {@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} field is
+ * guaranted to have a value between 0 and 4, inclusive.
+ *
+ * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
+ * @see CameraCharacteristics#SYNC_MAX_LATENCY
+ * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
+ */
+ public static final int REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6;
+
//
// Enumeration values for CameraCharacteristics#SCALER_CROPPING_TYPE
//
@@ -1259,8 +1279,7 @@ public abstract class CameraMetadata {
* image while recording video) use case.
* The camera device should take the highest-quality image
* possible (given the other settings) without disrupting the
- * frame rate of video recording.
- *
+ * frame rate of video recording.
* @see CaptureRequest#CONTROL_CAPTURE_INTENT
*/
public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4;