From c804d1cc871c1ab6091c16098a12457a6a3079e0 Mon Sep 17 00:00:00 2001
From: Chien-Yu Chen Include OIS data in the capture result. {@link CaptureResult#STATISTICS_OIS_SAMPLES android.statistics.oisSamples} provides OIS sample data in the
+ * output result metadata. A control for selecting whether OIS position information is included in output
* result metadata. When set to ON,
- * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}, android.statistics.oisShiftPixelX,
- * and android.statistics.oisShiftPixelY provide OIS data in the output result metadata. Possible values:
* Available values for this device: Optional - This value may be {@code null} on some devices. A control for selecting whether OIS position information is included in output
* result metadata. When set to ON,
- * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}, android.statistics.oisShiftPixelX,
- * and android.statistics.oisShiftPixelY provide OIS data in the output result metadata. Possible values:
* Available values for this device: Optional - This value may be {@code null} on some devices. Optional - This value may be {@code null} on some devices. An array of shifts of OIS samples, in x direction. The array contains the amount of shifts in x direction, in pixels, based on OIS samples.
* A positive value is a shift from left to right in active array coordinate system. For
- * example, if the optical center is (1000, 500) in active array coordinates, an shift of
+ * example, if the optical center is (1000, 500) in active array coordinates, a shift of
* (3, 0) puts the new optical center at (1003, 500). The number of shifts must match the number of timestamps in
- * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}.
*
* android.Statistics.info.availableOisDataModes
*
* android.Statistics.info.availableOisDataModes
Units: Pixels in active array.
*Optional - This value may be {@code null} on some devices.
- * - * @see CaptureResult#STATISTICS_OIS_TIMESTAMPS + * @hide */ - @PublicKey public static final KeyAn array of shifts of OIS samples, in y direction.
*The array contains the amount of shifts in y direction, in pixels, based on OIS samples. * A positive value is a shift from top to bottom in active array coordinate system. For - * example, if the optical center is (1000, 500) in active array coordinates, an shift of + * example, if the optical center is (1000, 500) in active array coordinates, a shift of * (0, 5) puts the new optical center at (1000, 505).
*The number of shifts must match the number of timestamps in - * {@link CaptureResult#STATISTICS_OIS_TIMESTAMPS android.statistics.oisTimestamps}.
+ * android.statistics.oisTimestamps. *Units: Pixels in active array.
*Optional - This value may be {@code null} on some devices.
- * - * @see CaptureResult#STATISTICS_OIS_TIMESTAMPS + * @hide */ - @PublicKey public static final KeyAn array of OIS samples.
+ *Each OIS sample contains the timestamp and the amount of shifts in x and y direction, + * in pixels, of the OIS sample.
+ *A positive value for a shift in x direction is a shift from left to right in active array + * coordinate system. For example, if the optical center is (1000, 500) in active array + * coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).
+ *A positive value for a shift in y direction is a shift from top to bottom in active array + * coordinate system. For example, if the optical center is (1000, 500) in active array + * coordinates, a shift of (0, 5) puts the new optical center at (1000, 505).
+ *Optional - This value may be {@code null} on some devices.
+ */ + @PublicKey + @SyntheticKey + public static final KeyTonemapping / contrast / gamma curve for the blue
* channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
index ebe2fa17a7c2..e4b1339fd663 100644
--- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
+++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
@@ -22,12 +22,12 @@ import android.graphics.Rect;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.CaptureResult;
-import android.hardware.camera2.marshal.Marshaler;
import android.hardware.camera2.marshal.MarshalQueryable;
import android.hardware.camera2.marshal.MarshalRegistry;
+import android.hardware.camera2.marshal.Marshaler;
import android.hardware.camera2.marshal.impl.MarshalQueryableArray;
-import android.hardware.camera2.marshal.impl.MarshalQueryableBoolean;
import android.hardware.camera2.marshal.impl.MarshalQueryableBlackLevelPattern;
+import android.hardware.camera2.marshal.impl.MarshalQueryableBoolean;
import android.hardware.camera2.marshal.impl.MarshalQueryableColorSpaceTransform;
import android.hardware.camera2.marshal.impl.MarshalQueryableEnum;
import android.hardware.camera2.marshal.impl.MarshalQueryableHighSpeedVideoConfiguration;
@@ -48,6 +48,7 @@ import android.hardware.camera2.marshal.impl.MarshalQueryableString;
import android.hardware.camera2.params.Face;
import android.hardware.camera2.params.HighSpeedVideoConfiguration;
import android.hardware.camera2.params.LensShadingMap;
+import android.hardware.camera2.params.OisSample;
import android.hardware.camera2.params.ReprocessFormatsMap;
import android.hardware.camera2.params.StreamConfiguration;
import android.hardware.camera2.params.StreamConfigurationDuration;
@@ -56,8 +57,8 @@ import android.hardware.camera2.params.TonemapCurve;
import android.hardware.camera2.utils.TypeReference;
import android.location.Location;
import android.location.LocationManager;
-import android.os.Parcelable;
import android.os.Parcel;
+import android.os.Parcelable;
import android.os.ServiceSpecificException;
import android.util.Log;
import android.util.Size;
@@ -614,6 +615,15 @@ public class CameraMetadataNative implements Parcelable {
return (T) metadata.getLensShadingMap();
}
});
+ sGetCommandMap.put(
+ CaptureResult.STATISTICS_OIS_SAMPLES.getNativeKey(),
+ new GetCommand() {
+ @Override
+ @SuppressWarnings("unchecked")
+ public {@link OisSample} contains the timestamp and the amount of shifts in x and y direction,
+ * in pixels, of the OIS sample.
+ *
+ * A positive value for a shift in x direction is a shift from left to right in active array
+ * coordinate system. For example, if the optical center is {@code (1000, 500)} in active array
+ * coordinates, a shift of {@code (3, 0)} puts the new optical center at {@code (1003, 500)}.
+ * A positive value for a shift in y direction is a shift from top to bottom in active array
+ * coordinate system. For example, if the optical center is {@code (1000, 500)} in active array
+ * coordinates, a shift of {@code (0, 5)} puts the new optical center at {@code (1000, 505)}.
+ * xShift and yShift must be finite; NaN and infinity is not allowed. The timestamps are in the same timebase as and comparable to
+ *{@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}. Two samples are only equal if and only if each of the OIS information is equal. {@code "OisSample{timestamp:%l, shift_x:%f, shift_y:%f}"} represents the OIS sample's
+ * timestamp, shift in x direction, and shift in y direction.