From 1d5f34a955c4d719a964dcafb928d73eab739c49 Mon Sep 17 00:00:00 2001 From: Changyeon Jo Date: Wed, 19 Jan 2022 22:21:35 -0800 Subject: [PATCH] Camera: Add automotive metadata section This CL adds a new automotive metadata section with below fields: - AUTOMOTIVE_LOCATION describes where the camera exists. - AUTOMOTIVE_LENS_FACING tells where the camera's lens is facing toward. Bug: 205156620 Test: m -j Change-Id: Iea1483a5afea7e290da6303b1999f17fc4a7778d --- core/api/current.txt | 29 +++ .../camera2/CameraCharacteristics.java | 134 ++++++++++++ .../hardware/camera2/CameraMetadata.java | 194 ++++++++++++++++++ .../hardware/camera2/CaptureResult.java | 3 + 4 files changed, 360 insertions(+) diff --git a/core/api/current.txt b/core/api/current.txt index ab18058902158..ca357e664b9c5 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -17276,6 +17276,8 @@ package android.hardware.camera2 { method @NonNull public java.util.List> getKeysNeedingPermission(); method @NonNull public java.util.Set getPhysicalCameraIds(); method @Nullable public android.hardware.camera2.params.RecommendedStreamConfigurationMap getRecommendedStreamConfigurationMap(int); + field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key AUTOMOTIVE_LENS_FACING; + field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key AUTOMOTIVE_LOCATION; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key CONTROL_AE_AVAILABLE_ANTIBANDING_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key CONTROL_AE_AVAILABLE_MODES; @@ -17509,6 +17511,32 @@ package android.hardware.camera2 { public abstract class CameraMetadata { method @NonNull public java.util.List getKeys(); + field public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT = 1; // 0x1 + field public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT = 3; // 0x3 + field public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER = 0; // 0x0 + field public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR = 2; // 0x2 + field public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT = 4; // 0x4 + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER = 5; // 0x5 + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER = 7; // 0x7 + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT = 6; // 0x6 + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT = 8; // 0x8 + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER = 10; // 0xa + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT = 9; // 0x9 + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT = 11; // 0xb + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER = 13; // 0xd + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT = 12; // 0xc + field public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT = 14; // 0xe + field public static final int AUTOMOTIVE_LOCATION_EXTERIOR_FRONT = 2; // 0x2 + field public static final int AUTOMOTIVE_LOCATION_EXTERIOR_LEFT = 4; // 0x4 + field public static final int AUTOMOTIVE_LOCATION_EXTERIOR_OTHER = 1; // 0x1 + field public static final int AUTOMOTIVE_LOCATION_EXTERIOR_REAR = 3; // 0x3 + field public static final int AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT = 5; // 0x5 + field public static final int AUTOMOTIVE_LOCATION_EXTRA_FRONT = 7; // 0x7 + field public static final int AUTOMOTIVE_LOCATION_EXTRA_LEFT = 9; // 0x9 + field public static final int AUTOMOTIVE_LOCATION_EXTRA_OTHER = 6; // 0x6 + field public static final int AUTOMOTIVE_LOCATION_EXTRA_REAR = 8; // 0x8 + field public static final int AUTOMOTIVE_LOCATION_EXTRA_RIGHT = 10; // 0xa + field public static final int AUTOMOTIVE_LOCATION_INTERIOR = 0; // 0x0 field public static final int COLOR_CORRECTION_ABERRATION_MODE_FAST = 1; // 0x1 field public static final int COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY = 2; // 0x2 field public static final int COLOR_CORRECTION_ABERRATION_MODE_OFF = 0; // 0x0 @@ -17643,6 +17671,7 @@ package android.hardware.camera2 { field public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED = 0; // 0x0 field public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0; // 0x0 field public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1; // 0x1 + field public static final int LENS_POSE_REFERENCE_AUTOMOTIVE = 3; // 0x3 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 diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index d2dc314585d6c..209c39b37b06f 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -1678,6 +1678,9 @@ public final class CameraCharacteristics extends CameraMetadata *

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 (0, 0, 0).

+ *

When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is AUTOMOTIVE, then this position is relative to the + * origin of the automotive sensor coordinate system, which is at the center of the rear + * axle.

*

Units: Meters

*

Optional - The value for this key may be {@code null} on some devices.

*

Permission {@link android.Manifest.permission#CAMERA } is needed to access this property

@@ -1824,6 +1827,7 @@ public final class CameraCharacteristics extends CameraMetadata{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA} *
  • {@link #LENS_POSE_REFERENCE_GYROSCOPE GYROSCOPE}
  • *
  • {@link #LENS_POSE_REFERENCE_UNDEFINED UNDEFINED}
  • + *
  • {@link #LENS_POSE_REFERENCE_AUTOMOTIVE AUTOMOTIVE}
  • * * *

    Optional - The value for this key may be {@code null} on some devices.

    @@ -1834,6 +1838,7 @@ public final class CameraCharacteristics extends CameraMetadata HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION = new Key("android.heic.availableHeicStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class); + /** + *

    The direction of the camera faces relative to the vehicle body frame and the + * passenger seats.

    + *

    This enum defines the lens facing characteristic of the cameras on the automotive + * devices with locations {@link CameraCharacteristics#AUTOMOTIVE_LOCATION android.automotive.location} defines. If the system has + * FEATURE_AUTOMOTIVE, the camera will have this entry in its static metadata.

    + *

    When {@link CameraCharacteristics#AUTOMOTIVE_LOCATION android.automotive.location} is INTERIOR, this has one or more INTERIOR_* + * values or a single EXTERIOR_* value. When this has more than one INTERIOR_*, + * the first value must be the one for the seat closest to the optical axis. If this + * contains INTERIOR_OTHER, all other values will be ineffective.

    + *

    When {@link CameraCharacteristics#AUTOMOTIVE_LOCATION android.automotive.location} is EXTERIOR_* or EXTRA, this has a single + * EXTERIOR_* value.

    + *

    If a camera has INTERIOR_OTHER or EXTERIOR_OTHER, or more than one camera is at the + * same location and facing the same direction, their static metadata will list the + * following entries, so that applications can determain their lenses' exact facing + * directions:

    + *
      + *
    • {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference}
    • + *
    • {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}
    • + *
    • {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}
    • + *
    + *

    Possible values:

    + *
      + *
    • {@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER EXTERIOR_OTHER}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT EXTERIOR_FRONT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR EXTERIOR_REAR}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT EXTERIOR_LEFT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT EXTERIOR_RIGHT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER INTERIOR_OTHER}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT INTERIOR_SEAT_ROW_1_LEFT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER INTERIOR_SEAT_ROW_1_CENTER}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT INTERIOR_SEAT_ROW_1_RIGHT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT INTERIOR_SEAT_ROW_2_LEFT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER INTERIOR_SEAT_ROW_2_CENTER}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT INTERIOR_SEAT_ROW_2_RIGHT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT INTERIOR_SEAT_ROW_3_LEFT}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER INTERIOR_SEAT_ROW_3_CENTER}
    • + *
    • {@link #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT INTERIOR_SEAT_ROW_3_RIGHT}
    • + *
    + * + *

    Optional - The value for this key may be {@code null} on some devices.

    + * + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + * @see CameraCharacteristics#LENS_POSE_REFERENCE + * @see CameraCharacteristics#LENS_POSE_ROTATION + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER + * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT + * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR + * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT + * @see #AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER + * @see #AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT + */ + @PublicKey + @NonNull + public static final Key AUTOMOTIVE_LENS_FACING = + new Key("android.automotive.lens.facing", int[].class); + + /** + *

    Location of the cameras on the automotive devices.

    + *

    This enum defines the locations of the cameras relative to the vehicle body frame on + * the automotive sensor coordinate system. + * If the system has FEATURE_AUTOMOTIVE, the camera will have this entry in its static + * metadata.

    + *
      + *
    • INTERIOR is the inside of the vehicle body frame (or the passenger cabin).
    • + *
    • EXTERIOR is the outside of the vehicle body frame.
    • + *
    • EXTRA is the extra vehicle such as a trailer.
    • + *
    + *

    Each side of the vehicle body frame on this coordinate system is defined as below:

    + *
      + *
    • FRONT is where the Y-axis increases toward.
    • + *
    • REAR is where the Y-axis decreases toward.
    • + *
    • LEFT is where the X-axis decreases toward.
    • + *
    • RIGHT is where the X-axis increases toward.
    • + *
    + *

    If the camera has either EXTERIOR_OTHER or EXTRA_OTHER, its static metadata will list + * the following entries, so that applications can determine the camera's exact location:

    + *
      + *
    • {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference}
    • + *
    • {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}
    • + *
    • {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}
    • + *
    + *

    Possible values:

    + *
      + *
    • {@link #AUTOMOTIVE_LOCATION_INTERIOR INTERIOR}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTERIOR_OTHER EXTERIOR_OTHER}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTERIOR_FRONT EXTERIOR_FRONT}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTERIOR_REAR EXTERIOR_REAR}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTERIOR_LEFT EXTERIOR_LEFT}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT EXTERIOR_RIGHT}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTRA_OTHER EXTRA_OTHER}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTRA_FRONT EXTRA_FRONT}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTRA_REAR EXTRA_REAR}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTRA_LEFT EXTRA_LEFT}
    • + *
    • {@link #AUTOMOTIVE_LOCATION_EXTRA_RIGHT EXTRA_RIGHT}
    • + *
    + * + *

    Optional - The value for this key may be {@code null} on some devices.

    + * + * @see CameraCharacteristics#LENS_POSE_REFERENCE + * @see CameraCharacteristics#LENS_POSE_ROTATION + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see #AUTOMOTIVE_LOCATION_INTERIOR + * @see #AUTOMOTIVE_LOCATION_EXTERIOR_OTHER + * @see #AUTOMOTIVE_LOCATION_EXTERIOR_FRONT + * @see #AUTOMOTIVE_LOCATION_EXTERIOR_REAR + * @see #AUTOMOTIVE_LOCATION_EXTERIOR_LEFT + * @see #AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT + * @see #AUTOMOTIVE_LOCATION_EXTRA_OTHER + * @see #AUTOMOTIVE_LOCATION_EXTRA_FRONT + * @see #AUTOMOTIVE_LOCATION_EXTRA_REAR + * @see #AUTOMOTIVE_LOCATION_EXTRA_LEFT + * @see #AUTOMOTIVE_LOCATION_EXTRA_RIGHT + */ + @PublicKey + @NonNull + public static final Key AUTOMOTIVE_LOCATION = + new Key("android.automotive.location", int.class); + /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * End generated code *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index 803684da6ddb0..ca6f9ab7f32c4 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -407,6 +407,15 @@ public abstract class CameraMetadata { */ public static final int LENS_POSE_REFERENCE_UNDEFINED = 2; + /** + *

    The value of {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} is relative to the origin of the + * automotive sensor coodinate system, which is at the center of the rear axle.

    + * + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see CameraCharacteristics#LENS_POSE_REFERENCE + */ + public static final int LENS_POSE_REFERENCE_AUTOMOTIVE = 3; + // // Enumeration values for CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES // @@ -1715,6 +1724,191 @@ public abstract class CameraMetadata { */ public static final int LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE_CALIBRATED = 1; + // + // Enumeration values for CameraCharacteristics#AUTOMOTIVE_LENS_FACING + // + + /** + *

    The camera device faces the outside of the vehicle body frame but not exactly + * one of the exterior sides defined by this enum. Applications should determine + * the exact facing direction from {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and + * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.

    + * + * @see CameraCharacteristics#LENS_POSE_ROTATION + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_OTHER = 0; + + /** + *

    The camera device faces the front of the vehicle body frame.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_FRONT = 1; + + /** + *

    The camera device faces the rear of the vehicle body frame.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_REAR = 2; + + /** + *

    The camera device faces the left side of the vehicle body frame.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_LEFT = 3; + + /** + *

    The camera device faces the right side of the vehicle body frame.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_EXTERIOR_RIGHT = 4; + + /** + *

    The camera device faces the inside of the vehicle body frame but not exactly + * one of seats described by this enum. Applications should determine the exact + * facing direction from {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.

    + * + * @see CameraCharacteristics#LENS_POSE_ROTATION + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_OTHER = 5; + + /** + *

    The camera device faces the left side seat of the first row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_LEFT = 6; + + /** + *

    The camera device faces the center seat of the first row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_CENTER = 7; + + /** + *

    The camera device faces the right seat of the first row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_1_RIGHT = 8; + + /** + *

    The camera device faces the left side seat of the second row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_LEFT = 9; + + /** + *

    The camera device faces the center seat of the second row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_CENTER = 10; + + /** + *

    The camera device faces the right side seat of the second row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_2_RIGHT = 11; + + /** + *

    The camera device faces the left side seat of the third row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_LEFT = 12; + + /** + *

    The camera device faces the center seat of the third row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_CENTER = 13; + + /** + *

    The camera device faces the right seat of the third row.

    + * @see CameraCharacteristics#AUTOMOTIVE_LENS_FACING + */ + public static final int AUTOMOTIVE_LENS_FACING_INTERIOR_SEAT_ROW_3_RIGHT = 14; + + // + // Enumeration values for CameraCharacteristics#AUTOMOTIVE_LOCATION + // + + /** + *

    The camera device exists inside of the vehicle cabin.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_INTERIOR = 0; + + /** + *

    The camera exists outside of the vehicle body frame but not exactly on one of the + * exterior locations this enum defines. The applications should determine the exact + * location from {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.

    + * + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTERIOR_OTHER = 1; + + /** + *

    The camera device exists outside of the vehicle body frame and on its front side.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTERIOR_FRONT = 2; + + /** + *

    The camera device exists outside of the vehicle body frame and on its rear side.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTERIOR_REAR = 3; + + /** + *

    The camera device exists outside and on left side of the vehicle body frame.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTERIOR_LEFT = 4; + + /** + *

    The camera device exists outside and on right side of the vehicle body frame.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTERIOR_RIGHT = 5; + + /** + *

    The camera device exists on an extra vehicle, such as the trailer, but not exactly + * on one of front, rear, left, or right side. Applications should determine the exact + * location from {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.

    + * + * @see CameraCharacteristics#LENS_POSE_TRANSLATION + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTRA_OTHER = 6; + + /** + *

    The camera device exists outside of the extra vehicle's body frame and on its front + * side.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTRA_FRONT = 7; + + /** + *

    The camera device exists outside of the extra vehicle's body frame and on its rear + * side.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTRA_REAR = 8; + + /** + *

    The camera device exists outside and on left side of the extra vehicle body.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTRA_LEFT = 9; + + /** + *

    The camera device exists outside and on right side of the extra vehicle body.

    + * @see CameraCharacteristics#AUTOMOTIVE_LOCATION + */ + public static final int AUTOMOTIVE_LOCATION_EXTRA_RIGHT = 10; + // // Enumeration values for CaptureRequest#COLOR_CORRECTION_MODE // diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index a0fb179add1c8..60d5e9eba3e05 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -3239,6 +3239,9 @@ public class CaptureResult extends CameraMetadata> { * with PRIMARY_CAMERA.

    *

    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 (0, 0, 0).

    + *

    When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is AUTOMOTIVE, then this position is relative to the + * origin of the automotive sensor coordinate system, which is at the center of the rear + * axle.

    *

    Units: Meters

    *

    Optional - The value for this key may be {@code null} on some devices.

    *

    Permission {@link android.Manifest.permission#CAMERA } is needed to access this property