From 51248bf60789b2fca61f2a5ce75808d58f63046d Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Thu, 22 Mar 2018 00:04:45 -0700 Subject: Camera: Add MONOCHROME camera capability Test: Camera CTS Bug: 74597035 Bug: 64691172 Change-Id: I0315faada2e69acfe3617fabe3e52563701e8ee7 --- api/current.txt | 1 + core/java/android/hardware/camera2/CameraCharacteristics.java | 2 ++ core/java/android/hardware/camera2/CameraMetadata.java | 7 +++++++ core/java/android/hardware/camera2/CaptureRequest.java | 4 ++++ core/java/android/hardware/camera2/CaptureResult.java | 4 ++++ 5 files changed, 18 insertions(+) diff --git a/api/current.txt b/api/current.txt index 5e7fa591385e..06e403d5e3f9 100644 --- a/api/current.txt +++ b/api/current.txt @@ -16074,6 +16074,7 @@ package android.hardware.camera2 { field public static final int REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11; // 0xb field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2; // 0x2 field public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1; // 0x1 + field public static final int REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12; // 0xc field public static final int REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING = 10; // 0xa field public static final int REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4; // 0x4 field public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3; // 0x3 diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index 390b83fe10cf..d0915b6a8622 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -1708,6 +1708,7 @@ public final class CameraCharacteristics extends CameraMetadata{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO} *
  • {@link #REQUEST_AVAILABLE_CAPABILITIES_MOTION_TRACKING MOTION_TRACKING}
  • *
  • {@link #REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA LOGICAL_MULTI_CAMERA}
  • + *
  • {@link #REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME}
  • *

    *

    This key is available on all devices.

    * @@ -1724,6 +1725,7 @@ public final class CameraCharacteristics extends CameraMetadata REQUEST_AVAILABLE_CAPABILITIES = diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index 7669c018acd1..bb9f246e5c0f 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -862,6 +862,13 @@ public abstract class CameraMetadata { */ public static final int REQUEST_AVAILABLE_CAPABILITIES_LOGICAL_MULTI_CAMERA = 11; + /** + *

    The camera device is a monochrome camera that doesn't contain a color filter array, + * and the pixel values on U and Y planes are all 128.

    + * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES + */ + public static final int REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12; + // // Enumeration values for CameraCharacteristics#SCALER_CROPPING_TYPE // diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index b0cbec71dfe6..f3a855faf7da 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -2853,6 +2853,8 @@ public final class CaptureRequest extends CameraMetadata> * of points can be less than max (that is, the request doesn't have to * always provide a curve with number of points equivalent to * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).

    + *

    For devices with MONOCHROME capability, only red channel is used. Green and blue channels + * are ignored.

    *

    A few examples, and their corresponding graphical mappings; these * only specify the red channel and the precision is limited to 4 * digits, for conciseness.

    @@ -2915,6 +2917,8 @@ public final class CaptureRequest extends CameraMetadata> * of points can be less than max (that is, the request doesn't have to * always provide a curve with number of points equivalent to * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).

    + *

    For devices with MONOCHROME capability, only red channel is used. Green and blue channels + * are ignored.

    *

    A few examples, and their corresponding graphical mappings; these * only specify the red channel and the precision is limited to 4 * digits, for conciseness.

    diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 633194243512..65ee5c538242 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -4096,6 +4096,8 @@ public class CaptureResult extends CameraMetadata> { * of points can be less than max (that is, the request doesn't have to * always provide a curve with number of points equivalent to * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).

    + *

    For devices with MONOCHROME capability, only red channel is used. Green and blue channels + * are ignored.

    *

    A few examples, and their corresponding graphical mappings; these * only specify the red channel and the precision is limited to 4 * digits, for conciseness.

    @@ -4158,6 +4160,8 @@ public class CaptureResult extends CameraMetadata> { * of points can be less than max (that is, the request doesn't have to * always provide a curve with number of points equivalent to * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).

    + *

    For devices with MONOCHROME capability, only red channel is used. Green and blue channels + * are ignored.

    *

    A few examples, and their corresponding graphical mappings; these * only specify the red channel and the precision is limited to 4 * digits, for conciseness.

    -- cgit v1.2.3-59-g8ed1b