OSDN Git Service

Camera2: Add croppingType tag
authorZhijun He <zhijunhe@google.com>
Fri, 23 May 2014 04:17:37 +0000 (21:17 -0700)
committerZhijun He <zhijunhe@google.com>
Fri, 23 May 2014 04:58:48 +0000 (21:58 -0700)
This is to indicate if the camera supports arbitrary cropping.

Bug: 15168075
Change-Id: Ib75f7af629be816229cc686c89980fec101301c0

api/current.txt
core/java/android/hardware/camera2/CameraCharacteristics.java
core/java/android/hardware/camera2/CameraMetadata.java
core/java/android/hardware/camera2/CaptureRequest.java
core/java/android/hardware/camera2/CaptureResult.java

index a021d59..30ca14e 100644 (file)
@@ -12199,6 +12199,7 @@ package android.hardware.camera2 {
     field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_PARTIAL_RESULT_COUNT;
     field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_PIPELINE_MAX_DEPTH;
     field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM;
+    field public static final android.hardware.camera2.CameraMetadata.Key SCALER_CROPPING_TYPE;
     field public static final android.hardware.camera2.CameraMetadata.Key SCALER_STREAM_CONFIGURATION_MAP;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_AVAILABLE_TEST_PATTERN_MODES;
     field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_BASE_GAIN_FACTOR;
@@ -12410,6 +12411,8 @@ package android.hardware.camera2 {
     field public static final int REQUEST_AVAILABLE_CAPABILITIES_DNG = 5; // 0x5
     field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 2; // 0x2
     field public static final int REQUEST_AVAILABLE_CAPABILITIES_ZSL = 4; // 0x4
+    field public static final int SCALER_CROPPING_TYPE_CENTER_ONLY = 0; // 0x0
+    field public static final int SCALER_CROPPING_TYPE_FREEFORM = 1; // 0x1
     field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3; // 0x3
     field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG = 2; // 0x2
     field public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1; // 0x1
index 7cc6d1d..164e683 100644 (file)
@@ -1046,6 +1046,28 @@ public final class CameraCharacteristics extends CameraMetadata {
             new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
 
     /**
+     * <p>The crop type that this camera device supports.</p>
+     * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
+     * device that only supports CENTER_ONLY cropping, the camera device will move the
+     * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
+     * and keep the crop region width and height unchanged. The camera device will return the
+     * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
+     * <p>Camera devices that support FREEFORM cropping will support any crop region that
+     * is inside of the active array. The camera device will apply the same crop region and
+     * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
+     * <p>FULL capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL) will support
+     * FREEFORM cropping.</p>
+     *
+     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
+     * @see CaptureRequest#SCALER_CROP_REGION
+     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
+     * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
+     * @see #SCALER_CROPPING_TYPE_FREEFORM
+     */
+    public static final Key<Integer> SCALER_CROPPING_TYPE =
+            new Key<Integer>("android.scaler.croppingType", int.class);
+
+    /**
      * <p>Area of raw data which corresponds to only
      * active pixels.</p>
      * <p>It is smaller or equal to
index a11390d..5455189 100644 (file)
@@ -446,6 +446,22 @@ public abstract class CameraMetadata {
     public static final int REQUEST_AVAILABLE_CAPABILITIES_DNG = 5;
 
     //
+    // Enumeration values for CameraCharacteristics#SCALER_CROPPING_TYPE
+    //
+
+    /**
+     * <p>The camera device will only support centered crop regions.</p>
+     * @see CameraCharacteristics#SCALER_CROPPING_TYPE
+     */
+    public static final int SCALER_CROPPING_TYPE_CENTER_ONLY = 0;
+
+    /**
+     * <p>The camera device will support arbitrarily chosen crop regions.</p>
+     * @see CameraCharacteristics#SCALER_CROPPING_TYPE
+     */
+    public static final int SCALER_CROPPING_TYPE_FREEFORM = 1;
+
+    //
     // Enumeration values for CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
     //
 
index b44b808..8e0f2ae 100644 (file)
@@ -569,9 +569,9 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
      * should be nonnegative.</p>
      * <p>If all regions have 0 weight, then no specific metering area
      * needs to be used by the camera device. If the metering region is
-     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
-     * will ignore the sections outside the region and output the
-     * used sections in the frame metadata.</p>
+     * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+     * the camera device will ignore the sections outside the region and output the
+     * used sections in the result metadata.</p>
      *
      * @see CaptureRequest#SCALER_CROP_REGION
      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
@@ -644,9 +644,9 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
      * should be nonnegative.</p>
      * <p>If all regions have 0 weight, then no specific focus area
      * needs to be used by the camera device. If the focusing region is
-     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
-     * will ignore the sections outside the region and output the
-     * used sections in the frame metadata.</p>
+     * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture
+     * result metadata, the camera device will ignore the sections outside
+     * the region and output the used sections in the result metadata.</p>
      *
      * @see CaptureRequest#SCALER_CROP_REGION
      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
@@ -731,9 +731,9 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable {
      * should be nonnegative.</p>
      * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area
      * needs to be used by the camera device. If the AWB region is
-     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
-     * will ignore the sections outside the region and output the
-     * used sections in the frame metadata.</p>
+     * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+     * the camera device will ignore the sections outside the region and output the
+     * used sections in the result metadata.</p>
      *
      * @see CaptureRequest#SCALER_CROP_REGION
      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
index b0cacf1..e0ddd57 100644 (file)
@@ -369,9 +369,9 @@ public final class CaptureResult extends CameraMetadata {
      * should be nonnegative.</p>
      * <p>If all regions have 0 weight, then no specific metering area
      * needs to be used by the camera device. If the metering region is
-     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
-     * will ignore the sections outside the region and output the
-     * used sections in the frame metadata.</p>
+     * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+     * the camera device will ignore the sections outside the region and output the
+     * used sections in the result metadata.</p>
      *
      * @see CaptureRequest#SCALER_CROP_REGION
      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
@@ -642,9 +642,9 @@ public final class CaptureResult extends CameraMetadata {
      * should be nonnegative.</p>
      * <p>If all regions have 0 weight, then no specific focus area
      * needs to be used by the camera device. If the focusing region is
-     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
-     * will ignore the sections outside the region and output the
-     * used sections in the frame metadata.</p>
+     * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture
+     * result metadata, the camera device will ignore the sections outside
+     * the region and output the used sections in the result metadata.</p>
      *
      * @see CaptureRequest#SCALER_CROP_REGION
      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
@@ -1126,9 +1126,9 @@ public final class CaptureResult extends CameraMetadata {
      * should be nonnegative.</p>
      * <p>If all regions have 0 weight, then no specific auto-white balance (AWB) area
      * needs to be used by the camera device. If the AWB region is
-     * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the camera device
-     * will ignore the sections outside the region and output the
-     * used sections in the frame metadata.</p>
+     * outside the the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata,
+     * the camera device will ignore the sections outside the region and output the
+     * used sections in the result metadata.</p>
      *
      * @see CaptureRequest#SCALER_CROP_REGION
      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE