diff options
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CameraCharacteristics.java | 13 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CameraMetadata.java | 14 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CaptureResult.java | 7 |
4 files changed, 34 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index 5ce5d6107982..ac824e64d7ed 100644 --- a/api/current.txt +++ b/api/current.txt @@ -17259,6 +17259,7 @@ package android.hardware.camera2 { field public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1; // 0x1 field public static final int LENS_POSE_REFERENCE_GYROSCOPE = 1; // 0x1 field public static final int LENS_POSE_REFERENCE_PRIMARY_CAMERA = 0; // 0x0 + field public static final int LENS_POSE_REFERENCE_UNDEFINED = 2; // 0x2 field public static final int LENS_STATE_MOVING = 1; // 0x1 field public static final int LENS_STATE_STATIONARY = 0; // 0x0 field public static final int LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_APPROXIMATE = 0; // 0x0 diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index a45648f06093..7bddc1decae1 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -1539,10 +1539,15 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p><code>p' = Rp</code></p> * <p>where <code>p</code> is in the device sensor coordinate system, and * <code>p'</code> is in the camera-oriented coordinate system.</p> + * <p>If {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, the quaternion rotation cannot + * be accurately represented by the camera device, and will be represented by + * default values matching its default facing.</p> * <p><b>Units</b>: * Quaternion coefficients</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> + * + * @see CameraCharacteristics#LENS_POSE_REFERENCE */ @PublicKey @NonNull @@ -1577,6 +1582,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to * the center of the primary gyroscope on the device. The axis definitions are the same as * with PRIMARY_CAMERA.</p> + * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, this position cannot be accurately + * represented by the camera device, and will be represented as <code>(0, 0, 0)</code>.</p> * <p><b>Units</b>: Meters</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> @@ -1714,20 +1721,24 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri new Key<float[]>("android.lens.radialDistortion", float[].class); /** - * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.</p> + * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, and the accuracy of + * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} and {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}.</p> * <p>Different calibration methods and use cases can produce better or worse results * depending on the selected coordinate origin.</p> * <p><b>Possible values:</b> * <ul> * <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li> * <li>{@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}</li> + * <li>{@link #LENS_POSE_REFERENCE_UNDEFINED UNDEFINED}</li> * </ul></p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> * + * @see CameraCharacteristics#LENS_POSE_ROTATION * @see CameraCharacteristics#LENS_POSE_TRANSLATION * @see #LENS_POSE_REFERENCE_PRIMARY_CAMERA * @see #LENS_POSE_REFERENCE_GYROSCOPE + * @see #LENS_POSE_REFERENCE_UNDEFINED */ @PublicKey @NonNull diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index 8e0a46d52dd6..8e62a038279d 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -366,6 +366,20 @@ public abstract class CameraMetadata<TKey> { */ public static final int LENS_POSE_REFERENCE_GYROSCOPE = 1; + /** + * <p>The camera device cannot represent the values of {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} + * and {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} accurately enough. One such example is a camera device + * on the cover of a foldable phone: in order to measure the pose translation and rotation, + * some kind of hinge position sensor would be needed.</p> + * <p>The value of {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} must be all zeros, and + * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} must be values matching its default facing.</p> + * + * @see CameraCharacteristics#LENS_POSE_ROTATION + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see CameraCharacteristics#LENS_POSE_REFERENCE + */ + public static final int LENS_POSE_REFERENCE_UNDEFINED = 2; + // // Enumeration values for CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES // diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 9b305b32b61d..6f0d1358a1b7 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -3027,10 +3027,15 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <p><code>p' = Rp</code></p> * <p>where <code>p</code> is in the device sensor coordinate system, and * <code>p'</code> is in the camera-oriented coordinate system.</p> + * <p>If {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, the quaternion rotation cannot + * be accurately represented by the camera device, and will be represented by + * default values matching its default facing.</p> * <p><b>Units</b>: * Quaternion coefficients</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> + * + * @see CameraCharacteristics#LENS_POSE_REFERENCE */ @PublicKey @NonNull @@ -3065,6 +3070,8 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to * the center of the primary gyroscope on the device. The axis definitions are the same as * with PRIMARY_CAMERA.</p> + * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is UNDEFINED, this position cannot be accurately + * represented by the camera device, and will be represented as <code>(0, 0, 0)</code>.</p> * <p><b>Units</b>: Meters</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Permission {@link android.Manifest.permission#CAMERA } is needed to access this property</b></p> |