Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34ace45e authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "Camera2: Revise MOTION_TRACKING capability"

parents c9f21f8f 601e0f6d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -15846,8 +15846,6 @@ package android.hardware.camera2 {
    method public abstract void createReprocessableCaptureSessionByConfigurations(android.hardware.camera2.params.InputConfiguration, java.util.List<android.hardware.camera2.params.OutputConfiguration>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) throws android.hardware.camera2.CameraAccessException;
    method public abstract java.lang.String getId();
    field public static final int TEMPLATE_MANUAL = 6; // 0x6
    field public static final int TEMPLATE_MOTION_TRACKING_BEST = 8; // 0x8
    field public static final int TEMPLATE_MOTION_TRACKING_PREVIEW = 7; // 0x7
    field public static final int TEMPLATE_PREVIEW = 1; // 0x1
    field public static final int TEMPLATE_RECORD = 3; // 0x3
    field public static final int TEMPLATE_STILL_CAPTURE = 2; // 0x2
+0 −3
Original line number Diff line number Diff line
@@ -1372,9 +1372,6 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * <p>The origin for {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}.</p>
     * <p>Different calibration methods and use cases can produce better or worse results
     * depending on the selected coordinate origin.</p>
     * <p>For devices designed to support the MOTION_TRACKING capability, the GYROSCOPE origin
     * makes device calibration and later usage by applications combining camera and gyroscope
     * information together simpler.</p>
     * <p><b>Possible values:</b>
     * <ul>
     *   <li>{@link #LENS_POSE_REFERENCE_PRIMARY_CAMERA PRIMARY_CAMERA}</li>
+1 −55
Original line number Diff line number Diff line
@@ -145,37 +145,6 @@ public abstract class CameraDevice implements AutoCloseable {
     */
    public static final int TEMPLATE_MANUAL = 6;

    /**
     * A template for selecting camera parameters that match TEMPLATE_PREVIEW as closely as
     * possible while improving the camera output for motion tracking use cases.
     *
     * <p>This template is best used by applications that are frequently switching between motion
     * tracking use cases and regular still capture use cases, to minimize the IQ changes
     * when swapping use cases.</p>
     *
     * <p>This template is guaranteed to be supported on camera devices that support the
     * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}
     * capability.</p>
     *
     * @see #createCaptureRequest
     */
    public static final int TEMPLATE_MOTION_TRACKING_PREVIEW = 7;

    /**
     * A template for selecting camera parameters that maximize the quality of camera output for
     * motion tracking use cases.
     *
     * <p>This template is best used by applications dedicated to motion tracking applications,
     * which aren't concerned about fast switches between motion tracking and other use cases.</p>
     *
     * <p>This template is guaranteed to be supported on camera devices that support the
     * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}
     * capability.</p>
     *
     * @see #createCaptureRequest
     */
    public static final int TEMPLATE_MOTION_TRACKING_BEST = 8;

     /** @hide */
     @Retention(RetentionPolicy.SOURCE)
     @IntDef(prefix = {"TEMPLATE_"}, value =
@@ -184,9 +153,7 @@ public abstract class CameraDevice implements AutoCloseable {
          TEMPLATE_RECORD,
          TEMPLATE_VIDEO_SNAPSHOT,
          TEMPLATE_ZERO_SHUTTER_LAG,
          TEMPLATE_MANUAL,
          TEMPLATE_MOTION_TRACKING_PREVIEW,
          TEMPLATE_MOTION_TRACKING_BEST})
          TEMPLATE_MANUAL})
     public @interface RequestTemplate {};

    /**
@@ -420,27 +387,6 @@ public abstract class CameraDevice implements AutoCloseable {
     * </table><br>
     * </p>
     *
     * <p>MOTION_TRACKING-capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES}
     * includes
     * {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING})
     * devices support at least the below stream combinations in addition to those for
     * {@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED} devices. The
     * {@code FULL FOV 640} entry means that the device will support a resolution that's 640 pixels
     * wide, with the height set so that the resolution aspect ratio matches the MAXIMUM output
     * aspect ratio, rounded down.  So for a device with a 4:3 image sensor, this will be 640x480,
     * and for a device with a 16:9 sensor, this will be 640x360, and so on. And the
     * {@code MAX 30FPS} entry means the largest JPEG resolution on the device for which
     * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration}
     * returns a value less than or equal to 1/30s.
     *
     * <table>
     * <tr><th colspan="7">MOTION_TRACKING-capability additional guaranteed configurations</th></tr>
     * <tr><th colspan="2" id="rb">Target 1</th><th colspan="2" id="rb">Target 2</th><th colspan="2" id="rb">Target 3</th><th rowspan="2">Sample use case(s)</th> </tr>
     * <tr><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th><th>Type</th><th id="rb">Max size</th></tr>
     * <tr> <td>{@code YUV}</td><td id="rb">{@code PREVIEW}</td> <td>{@code YUV }</td><td id="rb">{@code FULL FOV 640}</td> <td>{@code JPEG}</td><td id="rb">{@code MAX 30FPS}</td> <td>Preview with a tracking YUV output and a as-large-as-possible JPEG for still captures.</td> </tr>
     * </table><br>
     * </p>
     *
     * <p>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
+5 −40
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ public abstract class CameraMetadata<TKey> {
    /**
     * <p>The value of {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} is relative to the optical center of
     * the largest camera device facing the same direction as this camera.</p>
     * <p>This default value for API levels before Android P.</p>
     * <p>This is the default value for API levels before Android P.</p>
     *
     * @see CameraCharacteristics#LENS_POSE_TRANSLATION
     * @see CameraCharacteristics#LENS_POSE_REFERENCE
@@ -352,7 +352,6 @@ public abstract class CameraMetadata<TKey> {
    /**
     * <p>The value of {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation} is relative to the position of the
     * primary gyroscope of this Android device.</p>
     * <p>This is the value reported by all devices that support the MOTION_TRACKING capability.</p>
     *
     * @see CameraCharacteristics#LENS_POSE_TRANSLATION
     * @see CameraCharacteristics#LENS_POSE_REFERENCE
@@ -801,46 +800,12 @@ public abstract class CameraMetadata<TKey> {
    public static final int REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9;

    /**
     * <p>The device supports controls and metadata required for accurate motion tracking for
     * use cases such as augmented reality, electronic image stabilization, and so on.</p>
     * <p>This means this camera device has accurate optical calibration and timestamps relative
     * to the inertial sensors.</p>
     * <p>This capability requires the camera device to support the following:</p>
     * <ul>
     * <li>Capture request templates {@link android.hardware.camera2.CameraDevice#TEMPLATE_MOTION_TRACKING_PREVIEW } and {@link android.hardware.camera2.CameraDevice#TEMPLATE_MOTION_TRACKING_BEST } are defined.</li>
     * <li>The stream configurations listed in {@link android.hardware.camera2.CameraDevice#createCaptureSession } for MOTION_TRACKING are
     *   supported, either at 30 or 60fps maximum frame rate.</li>
     * <li>The following camera characteristics and capture result metadata are provided:<ul>
     * <li>{@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}</li>
     * <li>{@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}</li>
     * <li>{@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}</li>
     * <li>{@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}</li>
     * <li>{@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} with value GYROSCOPE</li>
     * </ul>
     * </li>
     * <li>The {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} field has value <code>REALTIME</code>. When compared to
     *   timestamps from the device's gyroscopes, the clock difference for events occuring at
     *   the same actual time instant will be less than 1 ms.</li>
     * <li>The value of the {@link CaptureResult#SENSOR_ROLLING_SHUTTER_SKEW android.sensor.rollingShutterSkew} field is accurate to within 1 ms.</li>
     * <li>The value of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} is guaranteed to be available in the
     *   capture result.</li>
     * <li>The {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} control supports MOTION_TRACKING to limit maximum
     *   exposure to 20 milliseconds.</li>
     * <li>The stream configurations required for MOTION_TRACKING (listed at {@link android.hardware.camera2.CameraDevice#createCaptureSession }) can operate at least at
     *   30fps; optionally, they can operate at 60fps, and '[60, 60]' is listed in
     *   {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}.</li>
     * </ul>
     * <p>The camera device supports the MOTION_TRACKING value for
     * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent}, which limits maximum exposure time to 20 ms.</p>
     * <p>This limits the motion blur of capture images, resulting in better image tracking
     * results for use cases such as image stabilization or augmented reality.</p>
     *
     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
     * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
     * @see CameraCharacteristics#LENS_POSE_REFERENCE
     * @see CameraCharacteristics#LENS_POSE_ROTATION
     * @see CameraCharacteristics#LENS_POSE_TRANSLATION
     * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
     * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
     * @see CaptureResult#SENSOR_ROLLING_SHUTTER_SKEW
     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
     */
    public static final int REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING = 10;
+2 −2
Original line number Diff line number Diff line
@@ -2757,11 +2757,11 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
            new Key<Integer>("android.statistics.lensShadingMapMode", int.class);

    /**
     * <p>Whether the camera device outputs the OIS data in output
     * <p>A control for selecting whether OIS position information is included in output
     * result metadata.</p>
     * <p>When set to ON,
     * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}, android.statistics.oisShiftPixelX,
     * android.statistics.oisShiftPixelY will provide OIS data in the output result metadata.</p>
     * and android.statistics.oisShiftPixelY provide OIS data in the output result metadata.</p>
     * <p><b>Possible values:</b>
     * <ul>
     *   <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li>
Loading