From 45fa43a1815e2d0a25ed3a126e4e732a03b7ed7f Mon Sep 17 00:00:00 2001
From: Zhijun He The sensor timestamp calibration quality. The sensor timestamp calibration quality determines the reliability of
+ * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} provided by the camera device. The standard reference illuminant used as the scene light source when
* calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
* {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 33e19150934f..5a02435d3a29 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -419,6 +419,33 @@ public abstract class CameraMetadata Timestamps from {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} are in nanoseconds and monotonic,
+ * but can not be compared to timestamps from other subsystems
+ * (e.g. accelerometer, gyro etc.), or other instances of the same or different
+ * camera devices in the same system. Timestamps between streams and results for
+ * a single camera instance are comparable, and the timestamps for all buffers
+ * and the result metadata generated by a single capture are identical. Timestamps from {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} are in the same timebase as
+ * android.os.SystemClock#elapsedRealtimeNanos(),
+ * and they can be compared to other timestamps using that base. Video stabilization automatically translates and scales images from the camera
* in order to stabilize motion between consecutive frames. If enabled, video stabilization can modify the
- * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream
- * stabilized Switching between different video stabilization modes may take several frames
+ * to initialize, the camera device will report the current mode in capture result
+ * metadata. For example, When "ON" mode is requested, the video stabilization modes
+ * in the first several capture results may still be "OFF", and it will become "ON"
+ * when the initialization is done. If a camera device supports both this mode and OIS ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}),
+ * turning both modes on may produce undesirable interaction, so it is recommended not to
+ * enable both at the same time.
Switching between different optical stabilization modes may take several + * frames to initialize, the camera device will report the current mode in + * capture result metadata. For example, When "ON" mode is requested, the + * optical stabilization modes in the first several capture results may still + * be "OFF", and it will become "ON" when the initialization is done.
+ *If a camera device supports both OIS and EIS ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), + * turning both modes on may produce undesirable interaction, so it is recommended not + * to enable both at the same time.
*Not all devices will support OIS; see * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for * available controls.
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 3d17ed37aeb0..65b662763f8f 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -1591,9 +1591,17 @@ public class CaptureResult extends CameraMetadataVideo stabilization automatically translates and scales images from the camera * in order to stabilize motion between consecutive frames.
*If enabled, video stabilization can modify the - * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream - * stabilized
- * + * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized. + *Switching between different video stabilization modes may take several frames + * to initialize, the camera device will report the current mode in capture result + * metadata. For example, When "ON" mode is requested, the video stabilization modes + * in the first several capture results may still be "OFF", and it will become "ON" + * when the initialization is done.
+ *If a camera device supports both this mode and OIS ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), + * turning both modes on may produce undesirable interaction, so it is recommended not to + * enable both at the same time.
+ * + * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE * @see CaptureRequest#SCALER_CROP_REGION * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON @@ -1846,6 +1854,14 @@ public class CaptureResult extends CameraMetadataSwitching between different optical stabilization modes may take several + * frames to initialize, the camera device will report the current mode in + * capture result metadata. For example, When "ON" mode is requested, the + * optical stabilization modes in the first several capture results may still + * be "OFF", and it will become "ON" when the initialization is done.
+ *If a camera device supports both OIS and EIS ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), + * turning both modes on may produce undesirable interaction, so it is recommended not + * to enable both at the same time.
*Not all devices will support OIS; see * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for * available controls.
@@ -2117,12 +2133,19 @@ public class CaptureResult extends CameraMetadataThe timestamps are also included in all image * buffers produced for the same capture, and will be identical - * on all the outputs. The timestamps measure time since an - * unspecified starting point, and are monotonically - * increasing.
- *They can be compared with the timestamps for other captures - * from the same camera device, but are not guaranteed to be - * comparable to any other time source.
+ * on all the outputs. + *When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} ==
UNCALIBRATED,
+ * the timestamps measure time since an unspecified starting point,
+ * and are monotonically increasing. They can be compared with the
+ * timestamps for other captures from the same camera device, but are
+ * not guaranteed to be comparable to any other time source.
When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION android.sensor.info.timestampCalibration} ==
CALIBRATED,
+ * the timestamps measure time in the same timebase as
+ * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
+ * compared to other timestamps from other subsystems that are using
+ * that base.