From 50f7243ca068c793c8b5aca37a9e983b630c477f Mon Sep 17 00:00:00 2001 From: Zhijun He Date: Wed, 28 May 2014 13:52:04 -0700 Subject: [PATCH] Camera2: Update spec for thumbnail cropping behavior Also update FULL capability spec (remove ZSL from the requirement list). Bug: 15168075 Change-Id: I864baf35ffab9047b52facb29011682e724bbc9b --- api/current.txt | 1 + .../camera2/CameraCharacteristics.java | 12 ++++----- .../hardware/camera2/CameraMetadata.java | 25 ++++++++++++++++--- .../hardware/camera2/CaptureRequest.java | 6 +++++ .../hardware/camera2/CaptureResult.java | 6 +++++ 5 files changed, 40 insertions(+), 10 deletions(-) diff --git a/api/current.txt b/api/current.txt index cddbbf8bf37ac..dddd6ae5cd209 100644 --- a/api/current.txt +++ b/api/current.txt @@ -12394,6 +12394,7 @@ package android.hardware.camera2 { field public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2; // 0x2 field public static final int NOISE_REDUCTION_MODE_OFF = 0; // 0x0 field public static final int REQUEST_AVAILABLE_CAPABILITIES_DNG = 5; // 0x5 + field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 3; // 0x3 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 diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index eb8d402c06fcb..cea68d2db166d 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -810,7 +810,6 @@ public final class CameraCharacteristics extends CameraMetadata== FULL devices:

* *

Other capabilities may be available on either FULL or LIMITED * devices, but the app. should query this field to be sure.

@@ -819,7 +818,7 @@ public final class CameraCharacteristics extends CameraMetadataA FULL device has the most support possible and will enable the * widest range of use cases such as:

*
    - *
  • 30 FPS at maximum resolution (== sensor resolution)
  • - *
  • Per frame control
  • - *
  • Manual sensor control
  • - *
  • Zero Shutter Lag (ZSL)
  • + *
  • 30fps at maximum resolution (== sensor resolution) is preferred, more than 20fps is required.
  • + *
  • Per frame control ({@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} == PER_FRAME_CONTROL)
  • + *
  • Manual sensor control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR)
  • + *
  • Manual post-processing control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_POST_PROCESSING)
  • *
*

A LIMITED device may have some or none of the above characteristics. * To find out more refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.

* * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES + * @see CameraCharacteristics#SYNC_MAX_LATENCY * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL */ diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index 27b4fb8ee6b10..b3e165e793eb7 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -236,9 +236,17 @@ public abstract class CameraMetadata { /** *

The camera device can be manually controlled (3A algorithms such - * as auto exposure, and auto focus can be - * bypassed), this includes but is not limited to:

+ * as auto exposure, and auto focus can be bypassed). + * The camera device supports basic manual control of the sensor image + * acquisition related stages. This means the following controls are + * guaranteed to be supported:

*
    + *
  • Manual frame duration control
      + *
    • {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
    • + *
    • {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}
    • + *
    • {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}
    • + *
    + *
  • *
  • Manual exposure control
      *
    • {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}
    • *
    • {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}
    • @@ -265,10 +273,15 @@ public abstract class CameraMetadata { *

      If any of the above 3A algorithms are enabled, then the camera * device will accurately report the values applied by 3A in the * result.

      + *

      A given camera device may also support additional manual sensor controls, + * but this capability only covers the above list of controls.

      * * @see CaptureRequest#BLACK_LEVEL_LOCK + * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP * @see CaptureRequest#SENSOR_EXPOSURE_TIME + * @see CaptureRequest#SENSOR_FRAME_DURATION * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE + * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE * @see CaptureRequest#SENSOR_SENSITIVITY * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES @@ -276,7 +289,9 @@ public abstract class CameraMetadata { public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 2; /** - *

      TODO: This should be @hide

      + *

      The camera device post-processing stages can be manually controlled. + * The camera device supports basic manual control of the image post-processing + * stages. This means the following controls are guaranteed to be supported:

      *
        *
      • Manual tonemap control
          *
        • {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}
        • @@ -299,6 +314,8 @@ public abstract class CameraMetadata { * will accurately report the values applied by AWB in the result.

          *

          The camera device will also support everything in MANUAL_SENSOR * except manual lens control and manual flash control.

          + *

          A given camera device may also support additional post-processing + * controls, but this capability only covers the above list of controls.

          * * @see CaptureRequest#COLOR_CORRECTION_GAINS * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM @@ -307,7 +324,7 @@ public abstract class CameraMetadata { * @see CaptureRequest#TONEMAP_MODE * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES */ - public static final int REQUEST_AVAILABLE_CAPABILITIES_GCAM = 3; + public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 3; /** *

          The camera device supports the Zero Shutter Lag use case.

          diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index 79659f1f5239a..6aa24e6e37805 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -1109,6 +1109,12 @@ public final class CaptureRequest extends CameraMetadata> * but the captured JPEG will still be a valid image.

          *

          When a jpeg image capture is issued, the thumbnail size selected should have * the same aspect ratio as the jpeg image.

          + *

          If the thumbnail image aspect ratio differs from the JPEG primary image aspect + * ratio, the camera device creates the thumbnail by cropping it from the primary image. + * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has + * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to + * generate the thumbnail image. The thumbnail image will always have a smaller Field + * Of View (FOV) than the primary image when aspect ratios differ.

          */ public static final Key JPEG_THUMBNAIL_SIZE = new Key("android.jpeg.thumbnailSize", android.util.Size.class); diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index aa202acc05127..42020eb161076 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -1697,6 +1697,12 @@ public class CaptureResult extends CameraMetadata> { * but the captured JPEG will still be a valid image.

          *

          When a jpeg image capture is issued, the thumbnail size selected should have * the same aspect ratio as the jpeg image.

          + *

          If the thumbnail image aspect ratio differs from the JPEG primary image aspect + * ratio, the camera device creates the thumbnail by cropping it from the primary image. + * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has + * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to + * generate the thumbnail image. The thumbnail image will always have a smaller Field + * Of View (FOV) than the primary image when aspect ratios differ.

          */ public static final Key JPEG_THUMBNAIL_SIZE = new Key("android.jpeg.thumbnailSize", android.util.Size.class);