From d9fc67ce3c1498a911df39675b61b96ec1364f08 Mon Sep 17 00:00:00 2001
From: Yin-Chia Yeh Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} LIMITED or FULL devices will always list This key is available on all devices. List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
* supported by this camera device. Not all the auto-focus modes may be supported by a
@@ -469,6 +480,22 @@ public final class CameraCharacteristics extends CameraMetadata List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
+ * device. This list contains control modes that can be set for the camera device.
+ * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
+ * devices will always support OFF, AUTO modes. Range of valid values: This key is available on all devices. List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
* device. This list contains scene modes that can be set for the camera device.
@@ -530,6 +557,17 @@ public final class CameraCharacteristics extends CameraMetadata Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} LIMITED or FULL devices will always list This key is available on all devices. List of the maximum number of regions that can be used for metering in
* auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
* this corresponds to the the maximum number of elements in
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index fb37ae5..e1b14cc 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -552,6 +552,8 @@ public final class CaptureRequest extends CameraMetadata The valid range of each matrix element varies on different devices, but
+ * values within [-1.5, 3.0] are guaranteed not to be clipped. Units: Unitless scale factors Optional - This value may be {@code null} on some devices. Full capability -
@@ -575,6 +577,10 @@ public final class CaptureRequest extends CameraMetadata The gains in the result metadata are the gains actually
* applied by the camera device to the current frame. The valid range of gains varies on different devices, but gains
+ * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
+ * device allows gains below 1.0, this is usually not recommended because
+ * this can create color artifacts. Units: Unitless gain factors Optional - This value may be {@code null} on some devices. Full capability -
@@ -1239,10 +1245,6 @@ public final class CaptureRequest extends CameraMetadata LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
- * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
- * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities.
- * FULL mode devices will always support OFF and OFF_KEEP_STATE. Possible values:
* Available values for this device: This key is available on all devices. The valid range of each matrix element varies on different devices, but
+ * values within [-1.5, 3.0] are guaranteed not to be clipped. Units: Unitless scale factors Optional - This value may be {@code null} on some devices. Full capability -
@@ -426,6 +428,10 @@ public class CaptureResult extends CameraMetadata The gains in the result metadata are the gains actually
* applied by the camera device to the current frame. The valid range of gains varies on different devices, but gains
+ * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
+ * device allows gains below 1.0, this is usually not recommended because
+ * this can create color artifacts. Units: Unitless gain factors Optional - This value may be {@code null} on some devices. Full capability -
@@ -1855,10 +1861,6 @@ public class CaptureResult extends CameraMetadata LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
- * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
- * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities.
- * FULL mode devices will always support OFF and OFF_KEEP_STATE. Possible values:
* true
+ * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}true
[0, 1.0]
(assuming input color
* values is within the normalized range [0, 1.0]
), or clipping may occur.
*
+ * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}[0, 1.0]
(assuming input color
* values is within the normalized range [0, 1.0]
), or clipping may occur.
*
Available values for this device:
+ * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}
This key is available on all devices.
* * @see CaptureRequest#CONTROL_AF_MODE + * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES * @see #CONTROL_MODE_OFF * @see #CONTROL_MODE_AUTO * @see #CONTROL_MODE_USE_SCENE_MODE diff --git a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java index 347db05..802b938 100644 --- a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java +++ b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java @@ -474,6 +474,15 @@ public class LegacyMetadataMapper { m.set(CONTROL_AE_COMPENSATION_STEP, ParamsUtils.createRational(step)); } + + /* + * control.aeLockAvailable + */ + { + boolean aeLockAvailable = p.isAutoExposureLockSupported(); + + m.set(CONTROL_AE_LOCK_AVAILABLE, aeLockAvailable); + } } @@ -571,6 +580,16 @@ public class LegacyMetadataMapper { Log.v(TAG, "mapControlAwb - control.awbAvailableModes set to " + ListUtils.listToString(awbAvail)); } + + + /* + * control.awbLockAvailable + */ + { + boolean awbLockAvailable = p.isAutoWhiteBalanceLockSupported(); + + m.set(CONTROL_AWB_LOCK_AVAILABLE, awbLockAvailable); + } } } @@ -618,17 +637,44 @@ public class LegacyMetadataMapper { /* * android.control.availableSceneModes */ + int maxNumDetectedFaces = p.getMaxNumDetectedFaces(); List