From 5a32b20ccc34fd7d4f048de05c427a7a96786531 Mon Sep 17 00:00:00 2001 From: Eino-Ville Talvala Date: Thu, 8 Aug 2013 12:38:36 -0700 Subject: Camera2: Add metadata keys and enum values - Insert metadata enum ints into CameraMetadata - Insert metadata Keys into relevant files - Remove some dead code in CameraMetadata Generated from /system/media/camera/docs. Change-Id: I3d864ad8c7add5f35ca740860cb2883d54a0791e --- api/current.txt | 253 +++- .../android/hardware/camera2/CameraDevice.java | 13 +- .../android/hardware/camera2/CameraMetadata.java | 1283 ++++++++++++++++---- .../android/hardware/camera2/CameraProperties.java | 602 ++++++--- .../android/hardware/camera2/CaptureRequest.java | 764 +++++++++++- .../android/hardware/camera2/CaptureResult.java | 872 +++++++++++-- 6 files changed, 3249 insertions(+), 538 deletions(-) diff --git a/api/current.txt b/api/current.txt index 002b8d77621b..d76a7851785d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10757,7 +10757,119 @@ package android.hardware.camera2 { method public void readFromParcel(android.os.Parcel); method public void set(android.hardware.camera2.CameraMetadata.Key, T); method public void writeToParcel(android.os.Parcel, int); + field public static final int COLOR_CORRECTION_MODE_FAST = 1; // 0x1 + field public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2; // 0x2 + field public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0; // 0x0 + field public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1; // 0x1 + field public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2; // 0x2 + field public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3; // 0x3 + field public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0; // 0x0 + field public static final int CONTROL_AE_MODE_OFF = 0; // 0x0 + field public static final int CONTROL_AE_MODE_ON = 1; // 0x1 + field public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3; // 0x3 + field public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2; // 0x2 + field public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4; // 0x4 + field public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0; // 0x0 + field public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1; // 0x1 + field public static final int CONTROL_AE_STATE_CONVERGED = 2; // 0x2 + field public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; // 0x4 + field public static final int CONTROL_AE_STATE_INACTIVE = 0; // 0x0 + field public static final int CONTROL_AE_STATE_LOCKED = 3; // 0x3 + field public static final int CONTROL_AE_STATE_PRECAPTURE = 5; // 0x5 + field public static final int CONTROL_AE_STATE_SEARCHING = 1; // 0x1 + field public static final int CONTROL_AF_MODE_AUTO = 1; // 0x1 + field public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4; // 0x4 + field public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3; // 0x3 + field public static final int CONTROL_AF_MODE_EDOF = 5; // 0x5 + field public static final int CONTROL_AF_MODE_MACRO = 2; // 0x2 + field public static final int CONTROL_AF_MODE_OFF = 0; // 0x0 + field public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3; // 0x3 + field public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4; // 0x4 + field public static final int CONTROL_AF_STATE_INACTIVE = 0; // 0x0 + field public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5; // 0x5 + field public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2; // 0x2 + field public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1; // 0x1 + field public static final int CONTROL_AF_TRIGGER_CANCEL = 2; // 0x2 + field public static final int CONTROL_AF_TRIGGER_IDLE = 0; // 0x0 + field public static final int CONTROL_AF_TRIGGER_START = 1; // 0x1 + field public static final int CONTROL_AWB_MODE_AUTO = 1; // 0x1 + field public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6; // 0x6 + field public static final int CONTROL_AWB_MODE_DAYLIGHT = 5; // 0x5 + field public static final int CONTROL_AWB_MODE_FLUORESCENT = 3; // 0x3 + field public static final int CONTROL_AWB_MODE_INCANDESCENT = 2; // 0x2 + field public static final int CONTROL_AWB_MODE_OFF = 0; // 0x0 + field public static final int CONTROL_AWB_MODE_SHADE = 8; // 0x8 + field public static final int CONTROL_AWB_MODE_TWILIGHT = 7; // 0x7 + field public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4; // 0x4 + field public static final int CONTROL_AWB_STATE_CONVERGED = 2; // 0x2 + field public static final int CONTROL_AWB_STATE_INACTIVE = 0; // 0x0 + field public static final int CONTROL_AWB_STATE_LOCKED = 3; // 0x3 + field public static final int CONTROL_AWB_STATE_SEARCHING = 1; // 0x1 + field public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; // 0x0 + field public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1; // 0x1 + field public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2; // 0x2 + field public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3; // 0x3 + field public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4; // 0x4 + field public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5; // 0x5 + field public static final int CONTROL_EFFECT_MODE_AQUA = 8; // 0x8 + field public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7; // 0x7 + field public static final int CONTROL_EFFECT_MODE_MONO = 1; // 0x1 + field public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2; // 0x2 + field public static final int CONTROL_EFFECT_MODE_OFF = 0; // 0x0 + field public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5; // 0x5 + field public static final int CONTROL_EFFECT_MODE_SEPIA = 4; // 0x4 + field public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3; // 0x3 + field public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6; // 0x6 + field public static final int CONTROL_MODE_AUTO = 1; // 0x1 + field public static final int CONTROL_MODE_OFF = 0; // 0x0 + field public static final int CONTROL_MODE_USE_SCENE_MODE = 2; // 0x2 + field public static final int CONTROL_SCENE_MODE_ACTION = 2; // 0x2 + field public static final int CONTROL_SCENE_MODE_BARCODE = 16; // 0x10 + field public static final int CONTROL_SCENE_MODE_BEACH = 8; // 0x8 + field public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15; // 0xf + field public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1; // 0x1 + field public static final int CONTROL_SCENE_MODE_FIREWORKS = 12; // 0xc + field public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4; // 0x4 + field public static final int CONTROL_SCENE_MODE_NIGHT = 5; // 0x5 + field public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6; // 0x6 + field public static final int CONTROL_SCENE_MODE_PARTY = 14; // 0xe + field public static final int CONTROL_SCENE_MODE_PORTRAIT = 3; // 0x3 + field public static final int CONTROL_SCENE_MODE_SNOW = 9; // 0x9 + field public static final int CONTROL_SCENE_MODE_SPORTS = 13; // 0xd + field public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11; // 0xb + field public static final int CONTROL_SCENE_MODE_SUNSET = 10; // 0xa + field public static final int CONTROL_SCENE_MODE_THEATRE = 7; // 0x7 + field public static final int CONTROL_SCENE_MODE_UNSUPPORTED = 0; // 0x0 field public static final android.os.Parcelable.Creator CREATOR; + field public static final int EDGE_MODE_FAST = 1; // 0x1 + field public static final int EDGE_MODE_HIGH_QUALITY = 2; // 0x2 + field public static final int EDGE_MODE_OFF = 0; // 0x0 + field public static final int FLASH_MODE_OFF = 0; // 0x0 + field public static final int FLASH_MODE_SINGLE = 1; // 0x1 + field public static final int FLASH_MODE_TORCH = 2; // 0x2 + field public static final int FLASH_STATE_CHARGING = 1; // 0x1 + field public static final int FLASH_STATE_FIRED = 3; // 0x3 + field public static final int FLASH_STATE_READY = 2; // 0x2 + field public static final int FLASH_STATE_UNAVAILABLE = 0; // 0x0 + field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; // 0x1 + field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; // 0x0 + field public static final int LENS_FACING_BACK = 1; // 0x1 + field public static final int LENS_FACING_FRONT = 0; // 0x0 + field public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0; // 0x0 + field public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1; // 0x1 + field public static final int LENS_STATE_STATIONARY = 0; // 0x0 + field public static final int NOISE_REDUCTION_MODE_FAST = 1; // 0x1 + 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 STATISTICS_FACE_DETECT_MODE_FULL = 2; // 0x2 + field public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0; // 0x0 + field public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1; // 0x1 + field public static final int STATISTICS_SCENE_FLICKER_50HZ = 1; // 0x1 + field public static final int STATISTICS_SCENE_FLICKER_60HZ = 2; // 0x2 + field public static final int STATISTICS_SCENE_FLICKER_NONE = 0; // 0x0 + field public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; // 0x0 + field public static final int TONEMAP_MODE_FAST = 1; // 0x1 + field public static final int TONEMAP_MODE_HIGH_QUALITY = 2; // 0x2 } public static class CameraMetadata.Key { @@ -10769,38 +10881,149 @@ package android.hardware.camera2 { public final class CameraProperties extends android.hardware.camera2.CameraMetadata { ctor public CameraProperties(); - field public static final android.hardware.camera2.CameraMetadata.Key INFO_IDENTIFIER; - field public static final android.hardware.camera2.CameraMetadata.Key INFO_MODEL; - field public static final android.hardware.camera2.CameraMetadata.Key INFO_REMOVABLE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_AVAILABLE_ANTIBANDING_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_COMPENSATION_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_COMPENSATION_STEP; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_AVAILABLE_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_EFFECTS; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_SCENE_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_AVAILABLE_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_MAX_REGIONS; + field public static final android.hardware.camera2.CameraMetadata.Key FLASH_INFO_AVAILABLE; field public static final android.hardware.camera2.CameraMetadata.Key INFO_SUPPORTED_HARDWARE_LEVEL; - field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; // 0x1 - field public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; // 0x0 + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_AVAILABLE_THUMBNAIL_SIZES; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FACING; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_APERTURES; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_FILTER_DENSITIES; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_FOCAL_LENGTHS; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_HYPERFOCAL_DISTANCE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_MINIMUM_FOCUS_DISTANCE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_INFO_SHADING_MAP_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_MAX_NUM_OUTPUT_STREAMS; field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_FORMATS; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_JPEG_MIN_DURATIONS; field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_JPEG_SIZES; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS; field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_PROCESSED_SIZES; - field public static final android.hardware.camera2.CameraMetadata.Key SCALER_AVAILABLE_RAW_SIZES; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_ACTIVE_ARRAY_SIZE; - field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_PIXEL_ARRAY_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_BASE_GAIN_FACTOR; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_ACTIVE_ARRAY_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_EXPOSURE_TIME_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_MAX_FRAME_DURATION; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_PHYSICAL_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_INFO_SENSITIVITY_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_MAX_ANALOG_SENSITIVITY; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_ORIENTATION; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_INFO_MAX_FACE_COUNT; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MAX_CURVE_POINTS; } public final class CaptureRequest extends android.hardware.camera2.CameraMetadata implements android.os.Parcelable { method public void addTarget(android.view.Surface); method public void removeTarget(android.view.Surface); + field public static final android.hardware.camera2.CameraMetadata.Key BLACK_LEVEL_LOCK; + field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_GAINS; + field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_TRANSFORM; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_ANTIBANDING_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_EXPOSURE_COMPENSATION; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_LOCK; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_PRECAPTURE_TRIGGER; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_REGIONS; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_TARGET_FPS_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_REGIONS; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_TRIGGER; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_LOCK; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_REGIONS; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_CAPTURE_INTENT; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_EFFECT_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_SCENE_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_VIDEO_STABILIZATION_MODE; field public static final android.os.Parcelable.Creator CREATOR; + field public static final android.hardware.camera2.CameraMetadata.Key EDGE_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key FLASH_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_COORDINATES; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_PROCESSING_METHOD; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_TIMESTAMP; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_ORIENTATION; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_QUALITY; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_QUALITY; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_APERTURE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FILTER_DENSITY; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCAL_LENGTH; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCUS_DISTANCE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_OPTICAL_STABILIZATION_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key NOISE_REDUCTION_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_CROP_REGION; field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_EXPOSURE_TIME; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FRAME_DURATION; field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_SENSITIVITY; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_DETECT_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_BLUE; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_GREEN; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_RED; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MODE; } public final class CaptureResult extends android.hardware.camera2.CameraMetadata { + field public static final android.hardware.camera2.CameraMetadata.Key BLACK_LEVEL_LOCK; + field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_GAINS; + field public static final android.hardware.camera2.CameraMetadata.Key COLOR_CORRECTION_TRANSFORM; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_REGIONS; field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AE_STATE; - field public static final int CONTROL_AE_STATE_CONVERGED = 2; // 0x2 - field public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; // 0x4 - field public static final int CONTROL_AE_STATE_INACTIVE = 0; // 0x0 - field public static final int CONTROL_AE_STATE_LOCKED = 3; // 0x3 - field public static final int CONTROL_AE_STATE_PRECAPTURE = 5; // 0x5 - field public static final int CONTROL_AE_STATE_SEARCHING = 1; // 0x1 + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_REGIONS; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AF_STATE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_REGIONS; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_AWB_STATE; + field public static final android.hardware.camera2.CameraMetadata.Key CONTROL_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key EDGE_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key FLASH_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key FLASH_STATE; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_COORDINATES; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_PROCESSING_METHOD; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_GPS_TIMESTAMP; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_ORIENTATION; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_QUALITY; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_QUALITY; + field public static final android.hardware.camera2.CameraMetadata.Key JPEG_THUMBNAIL_SIZE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_APERTURE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FILTER_DENSITY; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCAL_LENGTH; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCUS_DISTANCE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_FOCUS_RANGE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_OPTICAL_STABILIZATION_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key LENS_STATE; + field public static final android.hardware.camera2.CameraMetadata.Key NOISE_REDUCTION_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key REQUEST_FRAME_COUNT; + field public static final android.hardware.camera2.CameraMetadata.Key SCALER_CROP_REGION; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_EXPOSURE_TIME; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_FRAME_DURATION; + field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_SENSITIVITY; field public static final android.hardware.camera2.CameraMetadata.Key SENSOR_TIMESTAMP; - field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_DETECTED_FACES; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_DETECT_MODE; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_IDS; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_LANDMARKS; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_RECTANGLES; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_FACE_SCORES; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_LENS_SHADING_MAP; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_PREDICTED_COLOR_GAINS; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_PREDICTED_COLOR_TRANSFORM; + field public static final android.hardware.camera2.CameraMetadata.Key STATISTICS_SCENE_FLICKER; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_BLUE; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_GREEN; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_CURVE_RED; + field public static final android.hardware.camera2.CameraMetadata.Key TONEMAP_MODE; } public static class CaptureResult.Face { diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java index 422d82781ad3..c7780ce8463c 100644 --- a/core/java/android/hardware/camera2/CameraDevice.java +++ b/core/java/android/hardware/camera2/CameraDevice.java @@ -157,14 +157,13 @@ public interface CameraDevice extends AutoCloseable { * obtain the Surface with * {@link android.renderscript.Allocation#getSurface}. * - *
  • For access to uncompressed, JPEG, or raw sensor data in the - * application: Create a {@link android.media.ImageReader} object with the - * desired {@link CameraProperties#SCALER_AVAILABLE_FORMATS image format}, - * and a size from the matching + *
  • For access to uncompressed or JPEG data in the application: Create a + * {@link android.media.ImageReader} object with the desired + * {@link CameraProperties#SCALER_AVAILABLE_FORMATS image format}, and a + * size from the matching * {@link CameraProperties#SCALER_AVAILABLE_PROCESSED_SIZES processed}, - * {@link CameraProperties#SCALER_AVAILABLE_JPEG_SIZES jpeg}, or - * {@link CameraProperties#SCALER_AVAILABLE_RAW_SIZES raw} sizes. Then - * obtain a Surface from it.
  • + * {@link CameraProperties#SCALER_AVAILABLE_JPEG_SIZES jpeg}. Then obtain + * a Surface from it. * * * diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index e7f34d808769..3fda3b7b31b8 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -25,11 +25,6 @@ import android.os.Parcel; import android.util.Log; import java.lang.reflect.Array; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; @@ -275,110 +270,11 @@ public class CameraMetadata implements Parcelable, AutoCloseable { boolean sizeOnly) { MetadataMarshalClass marshaler = getMarshaler(type, nativeType); - if (marshaler != null) { - return marshaler.marshal(value, buffer, nativeType, sizeOnly); - } - - /** - * FIXME: This doesn't actually work because getFields() returns fields in an unordered - * manner. Although we could sort and get the data to come out correctly on the *java* side, - * it would not be data-compatible with our strict XML definitions. - * - * Rewrite this code to use Parcelables instead, they are most likely compatible with - * what we are trying to do in general. - */ - List instanceFields = findInstanceFields(type); - if (instanceFields.size() == 0) { - throw new UnsupportedOperationException("Class has no instance fields: " + type); - } - - int fieldCount = instanceFields.size(); - int bufferSize = 0; - - HashSet> fieldTypes = new HashSet>(); - for (Field f : instanceFields) { - fieldTypes.add(f.getType()); - } - - /** - * Pack arguments one field at a time. If we can't access field, look for its accessor - * method instead. - */ - for (int i = 0; i < fieldCount; ++i) { - Object arg; - - Field f = instanceFields.get(i); - - if ((f.getModifiers() & Modifier.PUBLIC) != 0) { - try { - arg = f.get(value); - } catch (IllegalAccessException e) { - throw new UnsupportedOperationException( - "Failed to access field " + f + " of type " + type, e); - } catch (IllegalArgumentException e) { - throw new UnsupportedOperationException( - "Illegal arguments when accessing field " + f + " of type " + type, e); - } - } else { - Method accessor = null; - // try to find a public accessor method - for(Method m : type.getMethods()) { - Log.v(TAG, String.format("Looking for getter in method %s for field %s", m, f)); - - // Must have 0 arguments - if (m.getParameterTypes().length != 0) { - continue; - } - - // Return type must be same as field type - if (m.getReturnType() != f.getType()) { - continue; - } - - // Strip 'm' from variable prefix if the next letter is capitalized - String fieldName = f.getName(); - char[] nameChars = f.getName().toCharArray(); - if (nameChars.length >= 2 && nameChars[0] == 'm' - && Character.isUpperCase(nameChars[1])) { - fieldName = String.valueOf(nameChars, /*start*/1, nameChars.length - 1); - } - - Log.v(TAG, String.format("Normalized field name: %s", fieldName)); - - // #getFoo() , getfoo(), foo(), all match. - if (m.getName().toLowerCase().equals(fieldName.toLowerCase()) || - m.getName().toLowerCase().equals("get" + fieldName.toLowerCase())) { - accessor = m; - break; - } - } - - if (accessor == null) { - throw new UnsupportedOperationException( - "Failed to find getter method for field " + f + " in type " + type); - } - - try { - arg = accessor.invoke(value); - } catch (IllegalAccessException e) { - // Impossible - throw new UnsupportedOperationException("Failed to access method + " + accessor - + " in type " + type, e); - } catch (IllegalArgumentException e) { - // Impossible - throw new UnsupportedOperationException("Bad arguments for method + " + accessor - + " in type " + type, e); - } catch (InvocationTargetException e) { - // Possibly but extremely unlikely - throw new UnsupportedOperationException("Failed to invoke method + " + accessor - + " in type " + type, e); - } - } - - bufferSize += packSingle(arg, buffer, (Class)f.getType(), nativeType, sizeOnly); + if (marshaler == null) { + throw new IllegalArgumentException(String.format("Unknown Key type: %s", type)); } - return bufferSize; + return marshaler.marshal(value, buffer, nativeType, sizeOnly); } private static int packArray(T value, ByteBuffer buffer, Class type, int nativeType, @@ -442,30 +338,6 @@ public class CameraMetadata implements Parcelable, AutoCloseable { return val; } - private static List findInstanceFields(Class type) { - List fields = new ArrayList(); - - for (Field f : type.getDeclaredFields()) { - if (f.isSynthetic()) { - throw new UnsupportedOperationException( - "Marshalling synthetic fields not supported in type " + type); - } - - // Skip static fields - int modifiers = f.getModifiers(); - if ((modifiers & Modifier.STATIC) == 0) { - fields.add(f); - } - - Log.v(TAG, String.format("Field %s has modifiers %d", f, modifiers)); - } - - if (type.getDeclaredFields().length == 0) { - Log.w(TAG, String.format("Type %s had 0 fields of any kind", type)); - } - return fields; - } - @SuppressWarnings({"unchecked", "rawtypes"}) private static T unpackSingle(ByteBuffer buffer, Class type, int nativeType) { @@ -486,84 +358,6 @@ public class CameraMetadata implements Parcelable, AutoCloseable { return instance; } - private static Constructor findApplicableConstructor(Class type) { - - List instanceFields = findInstanceFields(type); - if (instanceFields.size() == 0) { - throw new UnsupportedOperationException("Class has no instance fields: " + type); - } - - Constructor constructor = null; - int fieldCount = instanceFields.size(); - - HashSet> fieldTypes = new HashSet>(); - for (Field f : instanceFields) { - fieldTypes.add(f.getType()); - } - - /** - * Find which constructor to use: - * - must be public - * - same amount of arguments as there are instance fields - * - each argument is same type as each field (in any order) - */ - @SuppressWarnings("unchecked") - Constructor[] constructors = (Constructor[]) type.getConstructors(); - for (Constructor ctor : constructors) { - Log.v(TAG, String.format("Inspecting constructor '%s'", ctor)); - - Class[] parameterTypes = ctor.getParameterTypes(); - if (parameterTypes.length == fieldCount) { - boolean match = true; - - HashSet> argTypes = new HashSet>(); - for (Class t : parameterTypes) { - argTypes.add(t); - } - - // Order does not matter - match = argTypes.equals(fieldTypes); - - /* - // check if the types are the same - for (int i = 0; i < fieldCount; ++i) { - if (parameterTypes[i] != instanceFields.get(i).getType()) { - - Log.v(TAG, String.format( - "Constructor arg (%d) type %s did not match field type %s", i, - parameterTypes[i], instanceFields.get(i).getType())); - - match = false; - break; - } - } - */ - - if (match) { - constructor = ctor; - break; - } else { - Log.w(TAG, String.format("Constructor args did not have matching types")); - } - } else { - Log.v(TAG, String.format( - "Constructor did not have expected amount of fields (had %d, expected %d)", - parameterTypes.length, fieldCount)); - } - } - - if (constructors.length == 0) { - Log.w(TAG, String.format("Type %s had no public constructors", type)); - } - - if (constructor == null) { - throw new UnsupportedOperationException( - "Failed to find any applicable constructors for type " + type); - } - - return constructor; - } - private static > T unpackEnum(ByteBuffer buffer, Class type, int nativeType) { int ordinal = unpackSingleNative(buffer, Integer.TYPE, nativeType); @@ -573,55 +367,11 @@ public class CameraMetadata implements Parcelable, AutoCloseable { private static T unpackClass(ByteBuffer buffer, Class type, int nativeType) { MetadataMarshalClass marshaler = getMarshaler(type, nativeType); - if (marshaler != null) { - return marshaler.unmarshal(buffer, nativeType); - } - - /** - * FIXME: This doesn't actually work because getFields() returns fields in an unordered - * manner. Although we could sort and get the data to come out correctly on the *java* side, - * it would not be data-compatible with our strict XML definitions. - * - * Rewrite this code to use Parcelables instead, they are most likely compatible with - * what we are trying to do in general. - */ - - List instanceFields = findInstanceFields(type); - if (instanceFields.size() == 0) { - throw new UnsupportedOperationException("Class has no instance fields: " + type); - } - int fieldCount = instanceFields.size(); - - Constructor constructor = findApplicableConstructor(type); - - /** - * Build the arguments by unpacking one field at a time - * (note that while the field type might be different, the native type is the same) - */ - Object[] arguments = new Object[fieldCount]; - for (int i = 0; i < fieldCount; ++i) { - Object o = unpackSingle(buffer, instanceFields.get(i).getType(), nativeType); - arguments[i] = o; + if (marshaler == null) { + throw new IllegalArgumentException("Unknown class type: " + type); } - T instance; - try { - instance = constructor.newInstance(arguments); - } catch (InstantiationException e) { - // type is abstract class, interface, etc... - throw new UnsupportedOperationException("Failed to instantiate type " + type, e); - } catch (IllegalAccessException e) { - // This could happen if we have to access a private. - throw new UnsupportedOperationException("Failed to access type " + type, e); - } catch (IllegalArgumentException e) { - throw new UnsupportedOperationException("Illegal arguments for constructor of type " - + type, e); - } catch (InvocationTargetException e) { - throw new UnsupportedOperationException( - "Underlying constructor threw exception for type " + type, e); - } - - return instance; + return marshaler.unmarshal(buffer, nativeType); } @SuppressWarnings("unchecked") @@ -1011,4 +761,1025 @@ public class CameraMetadata implements Parcelable, AutoCloseable { Log.v(TAG, "Registered metadata marshalers"); } + + /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * The enum values below this point are generated from metadata + * definitions in /system/media/camera/docs. Do not modify by hand or + * modify the comment blocks at the start or end. + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ + + // + // Enumeration values for CameraProperties#LENS_FACING + // + + /** + * @see CameraProperties#LENS_FACING + */ + public static final int LENS_FACING_FRONT = 0; + + /** + * @see CameraProperties#LENS_FACING + */ + public static final int LENS_FACING_BACK = 1; + + // + // Enumeration values for CameraProperties#LED_AVAILABLE_LEDS + // + + /** + *

    + * android.led.transmit control is used + *

    + * @see CameraProperties#LED_AVAILABLE_LEDS + * @hide + */ + public static final int LED_AVAILABLE_LEDS_TRANSMIT = 0; + + // + // Enumeration values for CameraProperties#INFO_SUPPORTED_HARDWARE_LEVEL + // + + /** + * @see CameraProperties#INFO_SUPPORTED_HARDWARE_LEVEL + */ + public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; + + /** + * @see CameraProperties#INFO_SUPPORTED_HARDWARE_LEVEL + */ + public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; + + // + // Enumeration values for CaptureRequest#COLOR_CORRECTION_MODE + // + + /** + *

    + * Use the android.colorCorrection.transform matrix + * and android.colorCorrection.gains to do color conversion + *

    + * @see CaptureRequest#COLOR_CORRECTION_MODE + */ + public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0; + + /** + *

    + * Must not slow down frame rate relative to raw + * bayer output + *

    + * @see CaptureRequest#COLOR_CORRECTION_MODE + */ + public static final int COLOR_CORRECTION_MODE_FAST = 1; + + /** + *

    + * Frame rate may be reduced by high + * quality + *

    + * @see CaptureRequest#COLOR_CORRECTION_MODE + */ + public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2; + + // + // Enumeration values for CaptureRequest#CONTROL_AE_ANTIBANDING_MODE + // + + /** + * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE + */ + public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0; + + /** + * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE + */ + public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1; + + /** + * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE + */ + public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2; + + /** + * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE + */ + public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3; + + // + // Enumeration values for CaptureRequest#CONTROL_AE_MODE + // + + /** + *

    + * Autoexposure is disabled; sensor.exposureTime, + * sensor.sensitivity and sensor.frameDuration are used + *

    + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_OFF = 0; + + /** + *

    + * Autoexposure is active, no flash + * control + *

    + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_ON = 1; + + /** + *

    + * if flash exists Autoexposure is active, auto + * flash control; flash may be fired when precapture + * trigger is activated, and for captures for which + * captureIntent = STILL_CAPTURE + *

    + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2; + + /** + *

    + * if flash exists Autoexposure is active, auto + * flash control for precapture trigger and always flash + * when captureIntent = STILL_CAPTURE + *

    + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3; + + /** + *

    + * optional Automatic red eye reduction with flash. + * If deemed necessary, red eye reduction sequence should + * fire when precapture trigger is activated, and final + * flash should fire when captureIntent = + * STILL_CAPTURE + *

    + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4; + + // + // Enumeration values for CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER + // + + /** + *

    + * The trigger is idle. + *

    + * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER + */ + public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0; + + /** + *

    + * The precapture metering sequence + * must be started. The exact effect of the precapture + * trigger depends on the current AE mode and + * state. + *

    + * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER + */ + public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1; + + // + // Enumeration values for CaptureRequest#CONTROL_AF_MODE + // + + /** + *

    + * The 3A routines do not control the lens; + * android.lens.focusDistance is controlled by the + * application + *

    + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_OFF = 0; + + /** + *

    + * if lens is not fixed focus. + *

    + * Use android.lens.minimumFocusDistance to determine if lens + * is fixed focus In this mode, the lens does not move unless + * the autofocus trigger action is called. When that trigger + * is activated, AF must transition to ACTIVE_SCAN, then to + * the outcome of the scan (FOCUSED or + * NOT_FOCUSED). + *

    + * Triggering cancel AF resets the lens position to default, + * and sets the AF state to INACTIVE. + *

    + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_AUTO = 1; + + /** + *

    + * In this mode, the lens does not move unless the + * autofocus trigger action is called. + *

    + * When that trigger is activated, AF must transition to + * ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or + * NOT_FOCUSED). Triggering cancel AF resets the lens + * position to default, and sets the AF state to + * INACTIVE. + *

    + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_MACRO = 2; + + /** + *

    + * In this mode, the AF algorithm modifies the lens + * position continually to attempt to provide a + * constantly-in-focus image stream. + *

    + * The focusing behavior should be suitable for good quality + * video recording; typically this means slower focus + * movement and no overshoots. When the AF trigger is not + * involved, the AF algorithm should start in INACTIVE state, + * and then transition into PASSIVE_SCAN and PASSIVE_FOCUSED + * states as appropriate. When the AF trigger is activated, + * the algorithm should immediately transition into + * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the + * lens position until a cancel AF trigger is received. + *

    + * Once cancel is received, the algorithm should transition + * back to INACTIVE and resume passive scan. Note that this + * behavior is not identical to CONTINUOUS_PICTURE, since an + * ongoing PASSIVE_SCAN must immediately be + * canceled. + *

    + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3; + + /** + *

    + * In this mode, the AF algorithm modifies the lens + * position continually to attempt to provide a + * constantly-in-focus image stream. + *

    + * The focusing behavior should be suitable for still image + * capture; typically this means focusing as fast as + * possible. When the AF trigger is not involved, the AF + * algorithm should start in INACTIVE state, and then + * transition into PASSIVE_SCAN and PASSIVE_FOCUSED states as + * appropriate as it attempts to maintain focus. When the AF + * trigger is activated, the algorithm should finish its + * PASSIVE_SCAN if active, and then transition into + * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the + * lens position until a cancel AF trigger is received. + *

    + * When the AF cancel trigger is activated, the algorithm + * should transition back to INACTIVE and then act as if it + * has just been started. + *

    + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4; + + /** + *

    + * Extended depth of field (digital focus). AF + * trigger is ignored, AF state should always be + * INACTIVE. + *

    + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_EDOF = 5; + + // + // Enumeration values for CaptureRequest#CONTROL_AF_TRIGGER + // + + /** + *

    + * The trigger is idle. + *

    + * @see CaptureRequest#CONTROL_AF_TRIGGER + */ + public static final int CONTROL_AF_TRIGGER_IDLE = 0; + + /** + *

    + * Autofocus must trigger now. + *

    + * @see CaptureRequest#CONTROL_AF_TRIGGER + */ + public static final int CONTROL_AF_TRIGGER_START = 1; + + /** + *

    + * Autofocus must return to initial + * state, and cancel any active trigger. + *

    + * @see CaptureRequest#CONTROL_AF_TRIGGER + */ + public static final int CONTROL_AF_TRIGGER_CANCEL = 2; + + // + // Enumeration values for CaptureRequest#CONTROL_AWB_MODE + // + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_OFF = 0; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_AUTO = 1; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_INCANDESCENT = 2; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_FLUORESCENT = 3; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_DAYLIGHT = 5; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_TWILIGHT = 7; + + /** + * @see CaptureRequest#CONTROL_AWB_MODE + */ + public static final int CONTROL_AWB_MODE_SHADE = 8; + + // + // Enumeration values for CaptureRequest#CONTROL_CAPTURE_INTENT + // + + /** + *

    + * This request doesn't fall into the other + * categories. Default to preview-like + * behavior. + *

    + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; + + /** + *

    + * This request is for a preview-like usecase. The + * precapture trigger may be used to start off a metering + * w/flash sequence + *

    + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1; + + /** + *

    + * This request is for a still capture-type + * usecase. + *

    + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2; + + /** + *

    + * This request is for a video recording + * usecase. + *

    + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3; + + /** + *

    + * This request is for a video snapshot (still + * image while recording video) usecase + *

    + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4; + + /** + *

    + * This request is for a ZSL usecase; the + * application will stream full-resolution images and + * reprocess one or several later for a final + * capture + *

    + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5; + + // + // Enumeration values for CaptureRequest#CONTROL_EFFECT_MODE + // + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_OFF = 0; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_MONO = 1; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_SEPIA = 4; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7; + + /** + * @see CaptureRequest#CONTROL_EFFECT_MODE + */ + public static final int CONTROL_EFFECT_MODE_AQUA = 8; + + // + // Enumeration values for CaptureRequest#CONTROL_MODE + // + + /** + *

    + * Full application control of pipeline. All 3A + * routines are disabled, no other settings in + * android.control.* have any effect + *

    + * @see CaptureRequest#CONTROL_MODE + */ + public static final int CONTROL_MODE_OFF = 0; + + /** + *

    + * Use settings for each individual 3A routine. + * Manual control of capture parameters is disabled. All + * controls in android.control.* besides sceneMode take + * effect + *

    + * @see CaptureRequest#CONTROL_MODE + */ + public static final int CONTROL_MODE_AUTO = 1; + + /** + *

    + * Use specific scene mode. Enabling this disables + * control.aeMode, control.awbMode and control.afMode + * controls; the HAL must ignore those settings while + * USE_SCENE_MODE is active (except for FACE_PRIORITY + * scene mode). Other control entries are still active. + * This setting can only be used if availableSceneModes != + * UNSUPPORTED + *

    + * @see CaptureRequest#CONTROL_MODE + */ + public static final int CONTROL_MODE_USE_SCENE_MODE = 2; + + // + // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE + // + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_UNSUPPORTED = 0; + + /** + *

    + * if face detection support exists Use face + * detection data to drive 3A routines. If face detection + * statistics are disabled, should still operate correctly + * (but not return face detection statistics to the + * framework). + *

    + * Unlike the other scene modes, aeMode, awbMode, and afMode + * remain active when FACE_PRIORITY is set. This is due to + * compatibility concerns with the old camera + * API + *

    + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_ACTION = 2; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_PORTRAIT = 3; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_NIGHT = 5; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_THEATRE = 7; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_BEACH = 8; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_SNOW = 9; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_SUNSET = 10; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_FIREWORKS = 12; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_SPORTS = 13; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_PARTY = 14; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15; + + /** + * @see CaptureRequest#CONTROL_SCENE_MODE + */ + public static final int CONTROL_SCENE_MODE_BARCODE = 16; + + // + // Enumeration values for CaptureRequest#EDGE_MODE + // + + /** + *

    + * No edge enhancement is applied + *

    + * @see CaptureRequest#EDGE_MODE + */ + public static final int EDGE_MODE_OFF = 0; + + /** + *

    + * Must not slow down frame rate relative to raw + * bayer output + *

    + * @see CaptureRequest#EDGE_MODE + */ + public static final int EDGE_MODE_FAST = 1; + + /** + *

    + * Frame rate may be reduced by high + * quality + *

    + * @see CaptureRequest#EDGE_MODE + */ + public static final int EDGE_MODE_HIGH_QUALITY = 2; + + // + // Enumeration values for CaptureRequest#FLASH_MODE + // + + /** + *

    + * Do not fire the flash for this + * capture + *

    + * @see CaptureRequest#FLASH_MODE + */ + public static final int FLASH_MODE_OFF = 0; + + /** + *

    + * if android.flash.available is true Fire flash + * for this capture based on firingPower, + * firingTime. + *

    + * @see CaptureRequest#FLASH_MODE + */ + public static final int FLASH_MODE_SINGLE = 1; + + /** + *

    + * if android.flash.available is true Flash + * continuously on, power set by + * firingPower + *

    + * @see CaptureRequest#FLASH_MODE + */ + public static final int FLASH_MODE_TORCH = 2; + + // + // Enumeration values for CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE + // + + /** + * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE + */ + public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0; + + /** + * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE + */ + public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1; + + // + // Enumeration values for CaptureRequest#NOISE_REDUCTION_MODE + // + + /** + *

    + * No noise reduction is applied + *

    + * @see CaptureRequest#NOISE_REDUCTION_MODE + */ + public static final int NOISE_REDUCTION_MODE_OFF = 0; + + /** + *

    + * Must not slow down frame rate relative to raw + * bayer output + *

    + * @see CaptureRequest#NOISE_REDUCTION_MODE + */ + public static final int NOISE_REDUCTION_MODE_FAST = 1; + + /** + *

    + * May slow down frame rate to provide highest + * quality + *

    + * @see CaptureRequest#NOISE_REDUCTION_MODE + */ + public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2; + + // + // Enumeration values for CaptureRequest#STATISTICS_FACE_DETECT_MODE + // + + /** + * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE + */ + public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0; + + /** + *

    + * Optional Return rectangle and confidence + * only + *

    + * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE + */ + public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1; + + /** + *

    + * Optional Return all face + * metadata + *

    + * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE + */ + public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2; + + // + // Enumeration values for CaptureRequest#TONEMAP_MODE + // + + /** + *

    + * Use the tone mapping curve specified in + * android.tonemap.curve + *

    + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; + + /** + *

    + * Must not slow down frame rate relative to raw + * bayer output + *

    + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_FAST = 1; + + /** + *

    + * Frame rate may be reduced by high + * quality + *

    + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_HIGH_QUALITY = 2; + + // + // Enumeration values for CaptureResult#CONTROL_AE_STATE + // + + /** + *

    + * AE is off. When a camera device is opened, it starts in + * this state. + *

    + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_INACTIVE = 0; + + /** + *

    + * AE doesn't yet have a good set of control values + * for the current scene + *

    + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_SEARCHING = 1; + + /** + *

    + * AE has a good set of control values for the + * current scene + *

    + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_CONVERGED = 2; + + /** + *

    + * AE has been locked (aeMode = + * LOCKED) + *

    + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_LOCKED = 3; + + /** + *

    + * AE has a good set of control values, but flash + * needs to be fired for good quality still + * capture + *

    + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; + + /** + *

    + * AE has been asked to do a precapture sequence + * (through the + * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING) + * call), and is currently executing it. Once PRECAPTURE + * completes, AE will transition to CONVERGED or + * FLASH_REQUIRED as appropriate + *

    + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_PRECAPTURE = 5; + + // + // Enumeration values for CaptureResult#CONTROL_AF_STATE + // + + /** + *

    + * AF off or has not yet tried to scan/been asked + * to scan. When a camera device is opened, it starts in + * this state. + *

    + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_INACTIVE = 0; + + /** + *

    + * if CONTINUOUS_* modes are supported AF is + * currently doing an AF scan initiated by a continuous + * autofocus mode + *

    + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1; + + /** + *

    + * if CONTINUOUS_* modes are supported AF currently + * believes it is in focus, but may restart scanning at + * any time. + *

    + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2; + + /** + *

    + * if AUTO or MACRO modes are supported AF is doing + * an AF scan because it was triggered by AF + * trigger + *

    + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3; + + /** + *

    + * if any AF mode besides OFF is supported AF + * believes it is focused correctly and is + * locked + *

    + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4; + + /** + *

    + * if any AF mode besides OFF is supported AF has + * failed to focus successfully and is + * locked + *

    + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5; + + // + // Enumeration values for CaptureResult#CONTROL_AWB_STATE + // + + /** + *

    + * AWB is not in auto mode. When a camera device is opened, it + * starts in this state. + *

    + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_INACTIVE = 0; + + /** + *

    + * AWB doesn't yet have a good set of control + * values for the current scene + *

    + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_SEARCHING = 1; + + /** + *

    + * AWB has a good set of control values for the + * current scene + *

    + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_CONVERGED = 2; + + /** + *

    + * AE has been locked (aeMode = + * LOCKED) + *

    + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_LOCKED = 3; + + // + // Enumeration values for CaptureResult#FLASH_STATE + // + + /** + *

    + * No flash on camera + *

    + * @see CaptureResult#FLASH_STATE + */ + public static final int FLASH_STATE_UNAVAILABLE = 0; + + /** + *

    + * if android.flash.available is true Flash is + * charging and cannot be fired + *

    + * @see CaptureResult#FLASH_STATE + */ + public static final int FLASH_STATE_CHARGING = 1; + + /** + *

    + * if android.flash.available is true Flash is + * ready to fire + *

    + * @see CaptureResult#FLASH_STATE + */ + public static final int FLASH_STATE_READY = 2; + + /** + *

    + * if android.flash.available is true Flash fired + * for this capture + *

    + * @see CaptureResult#FLASH_STATE + */ + public static final int FLASH_STATE_FIRED = 3; + + // + // Enumeration values for CaptureResult#LENS_STATE + // + + /** + * @see CaptureResult#LENS_STATE + */ + public static final int LENS_STATE_STATIONARY = 0; + + // + // Enumeration values for CaptureResult#STATISTICS_SCENE_FLICKER + // + + /** + * @see CaptureResult#STATISTICS_SCENE_FLICKER + */ + public static final int STATISTICS_SCENE_FLICKER_NONE = 0; + + /** + * @see CaptureResult#STATISTICS_SCENE_FLICKER + */ + public static final int STATISTICS_SCENE_FLICKER_50HZ = 1; + + /** + * @see CaptureResult#STATISTICS_SCENE_FLICKER + */ + public static final int STATISTICS_SCENE_FLICKER_60HZ = 2; + + /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * End generated code + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ + } diff --git a/core/java/android/hardware/camera2/CameraProperties.java b/core/java/android/hardware/camera2/CameraProperties.java index 89e1f2a33294..e713d2176e2f 100644 --- a/core/java/android/hardware/camera2/CameraProperties.java +++ b/core/java/android/hardware/camera2/CameraProperties.java @@ -32,216 +32,466 @@ import java.util.List; * @see CameraManager */ public final class CameraProperties extends CameraMetadata { + + /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * The key entries below this point are generated from metadata + * definitions in /system/media/camera/docs. Do not modify by hand or + * modify the comment blocks at the start or end. + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ + /** - * The model name of the camera. For fixed (non-removable) cameras, this is - * the manufacturer's name. For removable cameras, this is a string that - * uniquely identifies the camera model and manufacturer. The - * {@link #INFO_IDENTIFIER} can be used to distinguish between multiple - * removable cameras of the same model. + *

    + * Which set of antibanding modes are + * supported + *

    */ - public static final Key INFO_MODEL = - new Key("android.info.model", String.class); + public static final Key CONTROL_AE_AVAILABLE_ANTIBANDING_MODES = + new Key("android.control.aeAvailableAntibandingModes", byte[].class); /** - * A unique identifier for this camera. For removable cameras, every - * camera will have a unique identifier, including two cameras of the - * same model and manufacturer. For non-removable cameras, the - * identifier is equal to the the device's id. + *

    + * List of frame rate ranges supported by the + * AE algorithm/hardware + *

    */ - public static final Key INFO_IDENTIFIER = - new Key("android.info.identifier", String.class); + public static final Key CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES = + new Key("android.control.aeAvailableTargetFpsRanges", int[].class); /** - *

    Whether this camera is removable or not.

    - * - *

    Applications using a removable camera must be prepared for the camera - * to be disconnected during use. Use the {@link #INFO_IDENTIFIER} field to - * determine if this camera is a match for a camera device seen earlier.

    + *

    + * Maximum and minimum exposure compensation + * setting, in counts of + * android.control.aeCompensationStepSize + *

    */ - public static final Key INFO_REMOVABLE = - new Key("android.info.isRemovable", Boolean.TYPE); + public static final Key CONTROL_AE_COMPENSATION_RANGE = + new Key("android.control.aeCompensationRange", int[].class); /** - *

    The hardware operational model of this device. One of the - * INFO_SUPPORTED_HARDWARE_LEVEL_* constants.

    - * - *

    Limited-capability devices have a number of limitations relative to - * full-capability cameras. Roughly, they have capabilities comparable to - * those provided by the deprecated {@link android.hardware.Camera} - * class.

    - * - *

    Specifically, limited-mode devices:

    - * - *
      - * - *
    1. Do not provide per-frame result metadata for repeating - * captures. This means that a CaptureListener will not be called for - * captures done through {@link CameraDevice#setRepeatingRequest - * setRepeatingRequest} or {@link CameraDevice#setRepeatingBurst - * setRepeatingBurst}.
    2. - * - *
    3. Do not support complete result metadata. Only a few fields are - * provided, such as the timestamp (TODO).
    4. - * - *
    5. Do not support manual capture controls. Only the (TODO) - * ANDROID_CONTROL_* fields and TODO controls are used, and the various - * AE/AF/AWB_OFF control values cannot be used.
    6. - * - *
    7. Do not support high frame rate captures. To obtain high frame rate, - * the {@link CameraDevice#setRepeatingRequest setRepeatingRequest} method - * must be used. The {@link CameraDevice#capture capture}, - * {@link CameraDevice#captureBurst captureBurst}, and - * {@link CameraDevice#setRepeatingBurst setRepeatingBurst} methods will - * result in slow frame captures.
    8. - * - *
    - * - * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED - * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL + *

    + * Smallest step by which exposure compensation + * can be changed + *

    */ - public static final Key INFO_SUPPORTED_HARDWARE_LEVEL = - new Key("android.info.supportedHardwareLevel", Integer.TYPE); + public static final Key CONTROL_AE_COMPENSATION_STEP = + new Key("android.control.aeCompensationStep", Rational.class); /** - *

    The type reported by limited-capability camera devices.

    - * - *

    Limited-capability devices have a number of limitations relative to - * full-capability cameras. Roughly, they have capabilities comparable to - * those provided by the deprecated {@link android.hardware.Camera} - * class.

    - * - *

    Specifically, limited-mode devices:

    - * - *
      - * - *
    1. Do not provide per-frame result metadata for repeating - * captures. This means that a CaptureListener will not be called for - * captures done through {@link CameraDevice#setRepeatingRequest - * setRepeatingRequest} or {@link CameraDevice#setRepeatingBurst - * setRepeatingBurst}.
    2. - * - *
    3. Do not support complete result metadata. Only a few fields are - * provided, such as the timestamp (TODO).
    4. - * - *
    5. Do not support manual capture controls. Only the (TODO) - * ANDROID_CONTROL_* fields and TODO controls are used, and the various - * AE/AF/AWB_OFF control values cannot be used.
    6. - * - *
    7. Do not support high frame rate captures. To obtain high frame rate, - * the {@link CameraDevice#setRepeatingRequest setRepeatingRequest} method - * must be used. The {@link CameraDevice#capture capture}, - * {@link CameraDevice#captureBurst captureBurst}, and - * {@link CameraDevice#setRepeatingBurst setRepeatingBurst} methods will - * result in slow frame captures.
    8. - * - *
    - * - * @see #INFO_SUPPORTED_HARDWARE_LEVEL + *

    + * List of AF modes that can be + * selected + *

    */ - public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; + public static final Key CONTROL_AF_AVAILABLE_MODES = + new Key("android.control.afAvailableModes", byte[].class); /** - *

    The type reported by full-capability camera devices

    - * - *

    Full-capability devices allow for per-frame control of capture - * hardware and post-processing parameters at high frame rates. They also - * provide output data at high resolution in uncompressed formats, in - * addition to compressed JPEG output.

    - * - * @see #INFO_SUPPORTED_HARDWARE_LEVEL + *

    + * what subset of the full color effect enum + * list is supported + *

    */ - public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; + public static final Key CONTROL_AVAILABLE_EFFECTS = + new Key("android.control.availableEffects", byte[].class); /** - *

    The available output formats from this camera device. When using a - * {@link android.media.ImageReader} as an output target, the - * ImageReader must be configured to use one of these formats.

    - * - *

    The list is a subset of the formats defined in - * {@link android.graphics.ImageFormat}.

    - * - *

    The image formats {@link android.graphics.ImageFormat#JPEG}, - * {@link android.graphics.ImageFormat#YUV_420_888} are guaranteed to be - * supported.

    + *

    + * what subset of the scene mode enum list is + * supported. + *

    + */ + public static final Key CONTROL_AVAILABLE_SCENE_MODES = + new Key("android.control.availableSceneModes", byte[].class); + + /** + *

    + * List of video stabilization modes that can + * be supported + *

    + */ + public static final Key CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES = + new Key("android.control.availableVideoStabilizationModes", byte[].class); + + /** + */ + public static final Key CONTROL_AWB_AVAILABLE_MODES = + new Key("android.control.awbAvailableModes", byte[].class); + + /** + *

    + * For AE, AWB, and AF, how many individual + * regions can be listed for metering? + *

    + */ + public static final Key CONTROL_MAX_REGIONS = + new Key("android.control.maxRegions", int.class); + + /** + *

    + * Whether this camera has a + * flash + *

    + *

    + * If no flash, none of the flash controls do + * anything. All other metadata should return 0 + *

    + */ + public static final Key FLASH_INFO_AVAILABLE = + new Key("android.flash.info.available", byte.class); + + /** + *

    + * Supported resolutions for the JPEG + * thumbnail + *

    + */ + public static final Key JPEG_AVAILABLE_THUMBNAIL_SIZES = + new Key("android.jpeg.availableThumbnailSizes", android.hardware.camera2.Size[].class); + + /** + *

    + * List of supported aperture + * values + *

    + *

    + * If variable aperture not available, only setting + * should be for the fixed aperture + *

    + */ + public static final Key LENS_INFO_AVAILABLE_APERTURES = + new Key("android.lens.info.availableApertures", float[].class); + + /** + *

    + * List of supported ND filter + * values + *

    + *

    + * If not available, only setting is 0. Otherwise, + * lists the available exposure index values for dimming + * (2 would mean the filter is set to reduce incoming + * light by two stops) + *

    + */ + public static final Key LENS_INFO_AVAILABLE_FILTER_DENSITIES = + new Key("android.lens.info.availableFilterDensities", float[].class); + + /** + *

    + * If fitted with optical zoom, what focal + * lengths are available. If not, the static focal + * length + *

    + *

    + * If optical zoom not supported, only one value + * should be reported + *

    + */ + public static final Key LENS_INFO_AVAILABLE_FOCAL_LENGTHS = + new Key("android.lens.info.availableFocalLengths", float[].class); + + /** + *

    + * List of supported optical image + * stabilization modes + *

    + */ + public static final Key LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION = + new Key("android.lens.info.availableOpticalStabilization", byte[].class); + + /** + *

    + * Hyperfocal distance for this lens; set to + * 0 if fixed focus + *

    + *

    + * The hyperfocal distance is used for the old + * API's 'fixed' setting + *

    + */ + public static final Key LENS_INFO_HYPERFOCAL_DISTANCE = + new Key("android.lens.info.hyperfocalDistance", float.class); + + /** + *

    + * Shortest distance from frontmost surface + * of the lens that can be focused correctly + *

    + *

    + * If the lens is fixed-focus, this should be + * 0 + *

    + */ + public static final Key LENS_INFO_MINIMUM_FOCUS_DISTANCE = + new Key("android.lens.info.minimumFocusDistance", float.class); + + /** + *

    + * Dimensions of lens shading + * map + *

    + */ + public static final Key LENS_INFO_SHADING_MAP_SIZE = + new Key("android.lens.info.shadingMapSize", android.hardware.camera2.Size.class); + + /** + *

    + * Direction the camera faces relative to + * device screen + *

    + * @see #LENS_FACING_FRONT + * @see #LENS_FACING_BACK + */ + public static final Key LENS_FACING = + new Key("android.lens.facing", int.class); + + /** + *

    + * How many output streams can be allocated at + * the same time for each type of stream + *

    + *

    + * Video snapshot with preview callbacks requires 3 + * processed streams (preview, record, app callbacks) and + * one JPEG stream (snapshot) + *

    + */ + public static final Key REQUEST_MAX_NUM_OUTPUT_STREAMS = + new Key("android.request.maxNumOutputStreams", int[].class); + + /** + *

    + * List of app-visible formats + *

    */ public static final Key SCALER_AVAILABLE_FORMATS = new Key("android.scaler.availableFormats", int[].class); /** - *

    The available output sizes for JPEG buffers from this camera - * device. When using a {@link android.media.ImageReader} as an output - * target, the ImageReader must be configured to use one of these sizes - * when using format {@link android.graphics.ImageFormat#JPEG}.

    + *

    + * The minimum frame duration that is supported + * for each resolution in availableJpegSizes. Should + * correspond to the frame duration when only that JPEG + * stream is active and captured in a burst, with all + * processing set to FAST + *

    + *

    + * When multiple streams are configured, the minimum + * frame duration will be >= max(individual stream min + * durations) + *

    */ - public static final Key SCALER_AVAILABLE_JPEG_SIZES = - new Key("android.scaler.availableJpegSizes", Size[].class); + public static final Key SCALER_AVAILABLE_JPEG_MIN_DURATIONS = + new Key("android.scaler.availableJpegMinDurations", long[].class); /** - *

    The available sizes for output buffers from this camera device, when - * the buffers are neither of the {@link android.graphics.ImageFormat#JPEG} - * or of the {@link android.graphics.ImageFormat#RAW_SENSOR} type.

    - * - *

    When using a {@link android.view.SurfaceView}, - * {@link android.graphics.SurfaceTexture}, - * {@link android.media.MediaRecorder}, {@link android.media.MediaCodec}, or - * {@link android.renderscript.Allocation} as an output target, that target - * must be configured to one of these sizes. See - * {@link CameraDevice#configureOutputs} for details. - * - *

    When using a {@link android.media.ImageReader} as an output - * target, the ImageReader must be configured to use one of these sizes - * when using format {@link android.graphics.ImageFormat#YUV_420_888}.

    - * + *

    + * The resolutions available for output from + * the JPEG block. Listed as width x height + *

    */ - public static final Key SCALER_AVAILABLE_PROCESSED_SIZES = - new Key("android.scaler.availableProcessedSizes", Size[].class); + public static final Key SCALER_AVAILABLE_JPEG_SIZES = + new Key("android.scaler.availableJpegSizes", android.hardware.camera2.Size[].class); /** - *

    The available sizes for output buffers from this camera device, when - * the buffers are of the {@link android.graphics.ImageFormat#RAW_SENSOR} type. This type of output may not be - * supported by the device; check {@link #SCALER_AVAILABLE_FORMATS} to - * check. In that case, this list will not exist.

    - * - *

    When using a {@link android.media.ImageReader} as an output - * target, the ImageReader must be configured to use one of these sizes - * when using image format {@link android.graphics.ImageFormat#RAW_SENSOR}.

    - */ - public static final Key SCALER_AVAILABLE_RAW_SIZES = - new Key("android.scaler.availableRawSizes", Size[].class); - - /** - *

    The coordinates of the sensor's active pixel array, relative to its - * total pixel array. These are the pixels that are actually used for image - * capture. The active pixel region may be smaller than the total number of - * pixels, if some pixels are used for other tasks such as calibrating the - * sensor's black level. If all pixels available for readout are used for - * imaging, then this rectangle will be - * {@code (0,0) - (SENSOR_PIXEL_ARRAY_SIZE.width, - * SENSOR_PIXEL_ARRAY_SIZE.height)}.

    - * - *

    If raw sensor capture is supported by this device, the width and - * height of the active pixel array match up to one of the supported raw - * capture sizes, and using that size will capture just the active pixel - * array region.

    - * - *

    Most other coordinates used by the camera device (for example, for - * metering and crop region selection, or for reporting detected faces) use - * a coordinate system based on the active array dimensions, with (0,0) - * being the top-left corner of the active array.

    + *

    + * The maximum ratio between active area width + * and crop region width, or between active area height and + * crop region height, if the crop region height is larger + * than width + *

    + */ + public static final Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM = + new Key("android.scaler.availableMaxDigitalZoom", float.class); + + /** + *

    + * The minimum frame duration that is supported + * for each resolution in availableProcessedSizes. Should + * correspond to the frame duration when only that processed + * stream is active, with all processing set to + * FAST + *

    + *

    + * When multiple streams are configured, the minimum + * frame duration will be >= max(individual stream min + * durations) + *

    + */ + public static final Key SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS = + new Key("android.scaler.availableProcessedMinDurations", long[].class); + + /** + *

    + * The resolutions available for use with + * processed output streams, such as YV12, NV12, and + * platform opaque YUV/RGB streams to the GPU or video + * encoders. Listed as width, height + *

    + */ + public static final Key SCALER_AVAILABLE_PROCESSED_SIZES = + new Key("android.scaler.availableProcessedSizes", android.hardware.camera2.Size[].class); + + /** + *

    + * Area of raw data which corresponds to only + * active pixels; smaller or equal to + * pixelArraySize. + *

    + */ + public static final Key SENSOR_INFO_ACTIVE_ARRAY_SIZE = + new Key("android.sensor.info.activeArraySize", android.graphics.Rect.class); + + /** + *

    + * Range of valid sensitivities + *

    + */ + public static final Key SENSOR_INFO_SENSITIVITY_RANGE = + new Key("android.sensor.info.sensitivityRange", int[].class); + + /** + *

    + * Range of valid exposure + * times + *

    + */ + public static final Key SENSOR_INFO_EXPOSURE_TIME_RANGE = + new Key("android.sensor.info.exposureTimeRange", long[].class); + + /** + *

    + * Maximum possible frame duration (minimum frame + * rate) + *

    + *

    + * Minimum duration is a function of resolution, + * processing settings. See + * android.scaler.availableProcessedMinDurations + * android.scaler.availableJpegMinDurations + * android.scaler.availableRawMinDurations + *

    + */ + public static final Key SENSOR_INFO_MAX_FRAME_DURATION = + new Key("android.sensor.info.maxFrameDuration", long.class); + + /** + *

    + * The physical dimensions of the full pixel + * array + *

    + *

    + * Needed for FOV calculation for old API + *

    + */ + public static final Key SENSOR_INFO_PHYSICAL_SIZE = + new Key("android.sensor.info.physicalSize", android.hardware.camera2.Size.class); + + /** + *

    + * Gain factor from electrons to raw units when + * ISO=100 + *

    + */ + public static final Key SENSOR_BASE_GAIN_FACTOR = + new Key("android.sensor.baseGainFactor", Rational.class); + + /** + *

    + * Maximum sensitivity that is implemented + * purely through analog gain + *

    + *

    + * For android.sensor.sensitivity values less than or + * equal to this, all applied gain must be analog. For + * values above this, it can be a mix of analog and + * digital + *

    + */ + public static final Key SENSOR_MAX_ANALOG_SENSITIVITY = + new Key("android.sensor.maxAnalogSensitivity", int.class); + + /** + *

    + * Clockwise angle through which the output + * image needs to be rotated to be upright on the device + * screen in its native orientation. Also defines the + * direction of rolling shutter readout, which is from top + * to bottom in the sensor's coordinate system + *

    */ - public static final Key SENSOR_ACTIVE_ARRAY_SIZE = - new Key("android.sensor.activeArraySize", Rect.class); + public static final Key SENSOR_ORIENTATION = + new Key("android.sensor.orientation", int.class); /** - *

    The size of the sensor's total pixel array available for readout. Some - * of these pixels may not be used for image capture, in which case - * {@link #SENSOR_ACTIVE_ARRAY_SIZE} will describe a rectangle smaller than - * this. If raw sensor capture is supported by this device, this is one of - * the supported capture sizes.

    + *

    + * Which face detection modes are available, + * if any + *

    + *

    + * OFF means face detection is disabled, it must + * be included in the list. + *

    + * SIMPLE means the device supports the + * android.statistics.faceRectangles and + * android.statistics.faceScores outputs. + *

    + * FULL means the device additionally supports the + * android.statistics.faceIds and + * android.statistics.faceLandmarks outputs. + *

    */ - public static final Key SENSOR_PIXEL_ARRAY_SIZE = - new Key("android.sensor.activeArraySize", Size.class); + public static final Key STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = + new Key("android.statistics.info.availableFaceDetectModes", byte[].class); - // TODO: Many more of these. + /** + *

    + * Maximum number of simultaneously detectable + * faces + *

    + */ + public static final Key STATISTICS_INFO_MAX_FACE_COUNT = + new Key("android.statistics.info.maxFaceCount", int.class); + + /** + *

    + * Maximum number of supported points in the + * tonemap curve + *

    + */ + public static final Key TONEMAP_MAX_CURVE_POINTS = + new Key("android.tonemap.maxCurvePoints", int.class); + + /** + *

    + * A list of camera LEDs that are available on this system. + *

    + * @see #LED_AVAILABLE_LEDS_TRANSMIT + * + * @hide + */ + public static final Key LED_AVAILABLE_LEDS = + new Key("android.led.availableLeds", int[].class); + + /** + *

    + * The camera 3 HAL device can implement one of two possible + * operational modes; limited and full. Full support is + * expected from new higher-end devices. Limited mode has + * hardware requirements roughly in line with those for a + * camera HAL device v1 implementation, and is expected from + * older or inexpensive devices. Full is a strict superset of + * limited, and they share the same essential operational flow. + *

    + * For full details refer to "S3. Operational Modes" in camera3.h + *

    + * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED + * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL + */ + public static final Key INFO_SUPPORTED_HARDWARE_LEVEL = + new Key("android.info.supportedHardwareLevel", int.class); + /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * End generated code + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ } diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index 15ba12c32e5b..1a10bdd9f295 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -54,21 +54,6 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable { private final Object mLock = new Object(); private final HashSet mSurfaceSet = new HashSet(); - /** - * The exposure time for this capture, in nanoseconds. - */ - public static final Key SENSOR_EXPOSURE_TIME = - new Key("android.sensor.exposureTime", Long.TYPE); - - /** - * The sensor sensitivity (gain) setting for this camera. - * This is represented as an ISO sensitivity value - */ - public static final Key SENSOR_SENSITIVITY = - new Key("android.sensor.sensitivity", Integer.TYPE); - - // Many more settings - /** * @hide */ @@ -152,4 +137,751 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable { } } -} \ No newline at end of file + /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * The key entries below this point are generated from metadata + * definitions in /system/media/camera/docs. Do not modify by hand or + * modify the comment blocks at the start or end. + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ + + /** + * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX + * @see #COLOR_CORRECTION_MODE_FAST + * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY + */ + public static final Key COLOR_CORRECTION_MODE = + new Key("android.colorCorrection.mode", int.class); + + /** + *

    + * A color transform matrix to use to transform + * from sensor RGB color space to output linear sRGB color space + *

    + *

    + * This matrix is either set by HAL when the request + * android.colorCorrection.mode is not TRANSFORM_MATRIX, or + * directly by the application in the request when the + * androird.colorCorrection.mode is TRANSFORM_MATRIX. + * In the latter case, the HAL may round the matrix to account + * for precision issues; the final rounded matrix should be + * reported back in this matrix result metadata. + *

    + */ + public static final Key COLOR_CORRECTION_TRANSFORM = + new Key("android.colorCorrection.transform", Rational[].class); + + /** + *

    + * Gains applying to Bayer color channels for + * white-balance + *

    + *

    + * The 4-channel white-balance gains are defined in + * the order of [R G_even G_odd B], where G_even is the gain + * for green pixels on even rows of the output, and G_odd + * is the gain for greenpixels on the odd rows. if a HAL + * does not support a separate gain for even/odd green channels, + * it should use the G_even value,and write G_odd equal to + * G_even in the output result metadata. + *

    + * The ouput should be the gains actually applied by the HAL to + * the current frame. + *

    + */ + public static final Key COLOR_CORRECTION_GAINS = + new Key("android.colorCorrection.gains", float[].class); + + /** + *

    + * Enum for controlling + * antibanding + *

    + * @see #CONTROL_AE_ANTIBANDING_MODE_OFF + * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ + * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ + * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO + */ + public static final Key CONTROL_AE_ANTIBANDING_MODE = + new Key("android.control.aeAntibandingMode", int.class); + + /** + *

    + * Adjustment to AE target image + * brightness + *

    + *

    + * For example, if EV step is 0.333, '6' will mean an + * exposure compensation of +2 EV; -3 will mean an exposure + * compensation of -1 + *

    + */ + public static final Key CONTROL_AE_EXPOSURE_COMPENSATION = + new Key("android.control.aeExposureCompensation", int.class); + + /** + *

    + * Whether AE is currently locked to its latest + * calculated values + *

    + *

    + * Note that even when AE is locked, the flash may be + * fired if the AE mode is ON_AUTO_FLASH / ON_ALWAYS_FLASH / + * ON_AUTO_FLASH_REDEYE. + *

    + */ + public static final Key CONTROL_AE_LOCK = + new Key("android.control.aeLock", boolean.class); + + /** + *

    + * Whether AE is currently updating the sensor + * exposure and sensitivity fields + *

    + *

    + * Only effective if android.control.mode = + * AUTO + *

    + * @see #CONTROL_AE_MODE_OFF + * @see #CONTROL_AE_MODE_ON + * @see #CONTROL_AE_MODE_ON_AUTO_FLASH + * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH + * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE + */ + public static final Key CONTROL_AE_MODE = + new Key("android.control.aeMode", int.class); + + /** + *

    + * List of areas to use for + * metering + *

    + *

    + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + *

    + * The coordinate system is based on the active pixel array, + * with (0,0) being the top-left of the active pixel array, and + * (android.sensor.info.activeArraySize.width, + * android.sensor.info.activeArraySize.height) being the + * bottom-right point of the active pixel array. The weight + * should be nonnegative. + *

    + * If all regions have 0 weight, then no specific metering area + * needs to be used by the HAL. If the metering region is + * outside the current android.scaler.cropRegion, the HAL + * should ignore the sections outside the region and output the + * used sections in the frame metadata + *

    + */ + public static final Key CONTROL_AE_REGIONS = + new Key("android.control.aeRegions", int[].class); + + /** + *

    + * Range over which fps can be adjusted to + * maintain exposure + *

    + *

    + * Only constrains AE algorithm, not manual control + * of android.sensor.exposureTime + *

    + */ + public static final Key CONTROL_AE_TARGET_FPS_RANGE = + new Key("android.control.aeTargetFpsRange", int[].class); + + /** + *

    + * Whether the HAL must trigger precapture + * metering. + *

    + *

    + * This entry is normally set to IDLE, or is not + * included at all in the request settings. When included and + * set to START, the HAL must trigger the autoexposure + * precapture metering sequence. + *

    + * The effect of AE precapture trigger depends on the current + * AE mode and state; see the camera HAL device v3 header for + * details. + *

    + * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE + * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START + */ + public static final Key CONTROL_AE_PRECAPTURE_TRIGGER = + new Key("android.control.aePrecaptureTrigger", int.class); + + /** + *

    + * Whether AF is currently enabled, and what + * mode it is set to + *

    + * @see #CONTROL_AF_MODE_OFF + * @see #CONTROL_AF_MODE_AUTO + * @see #CONTROL_AF_MODE_MACRO + * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO + * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE + * @see #CONTROL_AF_MODE_EDOF + */ + public static final Key CONTROL_AF_MODE = + new Key("android.control.afMode", int.class); + + /** + *

    + * List of areas to use for focus + * estimation + *

    + *

    + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + *

    + * The coordinate system is based on the active pixel array, + * with (0,0) being the top-left of the active pixel array, and + * (android.sensor.info.activeArraySize.width, + * android.sensor.info.activeArraySize.height) being the + * bottom-right point of the active pixel array. The weight + * should be nonnegative. + *

    + * If all regions have 0 weight, then no specific focus area + * needs to be used by the HAL. If the focusing region is + * outside the current android.scaler.cropRegion, the HAL + * should ignore the sections outside the region and output the + * used sections in the frame metadata + *

    + */ + public static final Key CONTROL_AF_REGIONS = + new Key("android.control.afRegions", int[].class); + + /** + *

    + * Whether the HAL must trigger autofocus. + *

    + *

    + * This entry is normally set to IDLE, or is not + * included at all in the request settings. + *

    + * When included and set to START, the HAL must trigger the + * autofocus algorithm. The effect of AF trigger depends on the + * current AF mode and state; see the camera HAL device v3 + * header for details. When set to CANCEL, the HAL must cancel + * any active trigger, and return to initial AF state. + *

    + * @see #CONTROL_AF_TRIGGER_IDLE + * @see #CONTROL_AF_TRIGGER_START + * @see #CONTROL_AF_TRIGGER_CANCEL + */ + public static final Key CONTROL_AF_TRIGGER = + new Key("android.control.afTrigger", int.class); + + /** + *

    + * Whether AWB is currently locked to its + * latest calculated values + *

    + *

    + * Note that AWB lock is only meaningful for AUTO + * mode; in other modes, AWB is already fixed to a specific + * setting + *

    + */ + public static final Key CONTROL_AWB_LOCK = + new Key("android.control.awbLock", boolean.class); + + /** + *

    + * Whether AWB is currently setting the color + * transform fields, and what its illumination target + * is + *

    + *

    + * [BC - AWB lock,AWB modes] + *

    + * @see #CONTROL_AWB_MODE_OFF + * @see #CONTROL_AWB_MODE_AUTO + * @see #CONTROL_AWB_MODE_INCANDESCENT + * @see #CONTROL_AWB_MODE_FLUORESCENT + * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT + * @see #CONTROL_AWB_MODE_DAYLIGHT + * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT + * @see #CONTROL_AWB_MODE_TWILIGHT + * @see #CONTROL_AWB_MODE_SHADE + */ + public static final Key CONTROL_AWB_MODE = + new Key("android.control.awbMode", int.class); + + /** + *

    + * List of areas to use for illuminant + * estimation + *

    + *

    + * Only used in AUTO mode. + *

    + * Each area is a rectangle plus weight: xmin, ymin, xmax, + * ymax, weight. The coordinate system is based on the active + * pixel array, with (0,0) being the top-left of the active + * pixel array, and (android.sensor.info.activeArraySize.width, + * android.sensor.info.activeArraySize.height) being the + * bottom-right point of the active pixel array. The weight + * should be nonnegative. + *

    + * If all regions have 0 weight, then no specific metering area + * needs to be used by the HAL. If the metering region is + * outside the current android.scaler.cropRegion, the HAL + * should ignore the sections outside the region and output the + * used sections in the frame metadata + *

    + */ + public static final Key CONTROL_AWB_REGIONS = + new Key("android.control.awbRegions", int[].class); + + /** + *

    + * Information to 3A routines about the purpose + * of this capture, to help decide optimal 3A + * strategy + *

    + *

    + * Only used if android.control.mode != OFF. + *

    + * @see #CONTROL_CAPTURE_INTENT_CUSTOM + * @see #CONTROL_CAPTURE_INTENT_PREVIEW + * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE + * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD + * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT + * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG + */ + public static final Key CONTROL_CAPTURE_INTENT = + new Key("android.control.captureIntent", int.class); + + /** + *

    + * Whether any special color effect is in use. + * Only used if android.control.mode != OFF + *

    + * @see #CONTROL_EFFECT_MODE_OFF + * @see #CONTROL_EFFECT_MODE_MONO + * @see #CONTROL_EFFECT_MODE_NEGATIVE + * @see #CONTROL_EFFECT_MODE_SOLARIZE + * @see #CONTROL_EFFECT_MODE_SEPIA + * @see #CONTROL_EFFECT_MODE_POSTERIZE + * @see #CONTROL_EFFECT_MODE_WHITEBOARD + * @see #CONTROL_EFFECT_MODE_BLACKBOARD + * @see #CONTROL_EFFECT_MODE_AQUA + */ + public static final Key CONTROL_EFFECT_MODE = + new Key("android.control.effectMode", int.class); + + /** + *

    + * Overall mode of 3A control + * routines + *

    + * @see #CONTROL_MODE_OFF + * @see #CONTROL_MODE_AUTO + * @see #CONTROL_MODE_USE_SCENE_MODE + */ + public static final Key CONTROL_MODE = + new Key("android.control.mode", int.class); + + /** + *

    + * Which scene mode is active when + * android.control.mode = SCENE_MODE + *

    + * @see #CONTROL_SCENE_MODE_UNSUPPORTED + * @see #CONTROL_SCENE_MODE_FACE_PRIORITY + * @see #CONTROL_SCENE_MODE_ACTION + * @see #CONTROL_SCENE_MODE_PORTRAIT + * @see #CONTROL_SCENE_MODE_LANDSCAPE + * @see #CONTROL_SCENE_MODE_NIGHT + * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT + * @see #CONTROL_SCENE_MODE_THEATRE + * @see #CONTROL_SCENE_MODE_BEACH + * @see #CONTROL_SCENE_MODE_SNOW + * @see #CONTROL_SCENE_MODE_SUNSET + * @see #CONTROL_SCENE_MODE_STEADYPHOTO + * @see #CONTROL_SCENE_MODE_FIREWORKS + * @see #CONTROL_SCENE_MODE_SPORTS + * @see #CONTROL_SCENE_MODE_PARTY + * @see #CONTROL_SCENE_MODE_CANDLELIGHT + * @see #CONTROL_SCENE_MODE_BARCODE + */ + public static final Key CONTROL_SCENE_MODE = + new Key("android.control.sceneMode", int.class); + + /** + *

    + * Whether video stabilization is + * active + *

    + *

    + * If enabled, video stabilization can modify the + * android.scaler.cropRegion to keep the video stream + * stabilized + *

    + */ + public static final Key CONTROL_VIDEO_STABILIZATION_MODE = + new Key("android.control.videoStabilizationMode", boolean.class); + + /** + *

    + * Operation mode for edge + * enhancement + *

    + * @see #EDGE_MODE_OFF + * @see #EDGE_MODE_FAST + * @see #EDGE_MODE_HIGH_QUALITY + */ + public static final Key EDGE_MODE = + new Key("android.edge.mode", int.class); + + /** + *

    + * Select flash operation mode + *

    + * @see #FLASH_MODE_OFF + * @see #FLASH_MODE_SINGLE + * @see #FLASH_MODE_TORCH + */ + public static final Key FLASH_MODE = + new Key("android.flash.mode", int.class); + + /** + *

    + * GPS coordinates to include in output JPEG + * EXIF + *

    + */ + public static final Key JPEG_GPS_COORDINATES = + new Key("android.jpeg.gpsCoordinates", double[].class); + + /** + *

    + * 32 characters describing GPS algorithm to + * include in EXIF + *

    + */ + public static final Key JPEG_GPS_PROCESSING_METHOD = + new Key("android.jpeg.gpsProcessingMethod", String.class); + + /** + *

    + * Time GPS fix was made to include in + * EXIF + *

    + */ + public static final Key JPEG_GPS_TIMESTAMP = + new Key("android.jpeg.gpsTimestamp", long.class); + + /** + *

    + * Orientation of JPEG image to + * write + *

    + */ + public static final Key JPEG_ORIENTATION = + new Key("android.jpeg.orientation", int.class); + + /** + *

    + * Compression quality of the final JPEG + * image + *

    + *

    + * 85-95 is typical usage range + *

    + */ + public static final Key JPEG_QUALITY = + new Key("android.jpeg.quality", byte.class); + + /** + *

    + * Compression quality of JPEG + * thumbnail + *

    + */ + public static final Key JPEG_THUMBNAIL_QUALITY = + new Key("android.jpeg.thumbnailQuality", byte.class); + + /** + *

    + * Resolution of embedded JPEG + * thumbnail + *

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

    + * Size of the lens aperture + *

    + *

    + * Will not be supported on most devices. Can only + * pick from supported list + *

    + */ + public static final Key LENS_APERTURE = + new Key("android.lens.aperture", float.class); + + /** + *

    + * State of lens neutral density + * filter(s) + *

    + *

    + * Will not be supported on most devices. Can only + * pick from supported list + *

    + */ + public static final Key LENS_FILTER_DENSITY = + new Key("android.lens.filterDensity", float.class); + + /** + *

    + * Lens optical zoom setting + *

    + *

    + * Will not be supported on most devices. + *

    + */ + public static final Key LENS_FOCAL_LENGTH = + new Key("android.lens.focalLength", float.class); + + /** + *

    + * Distance to plane of sharpest focus, + * measured from frontmost surface of the lens + *

    + *

    + * 0 = infinity focus. Used value should be clamped + * to (0,minimum focus distance) + *

    + */ + public static final Key LENS_FOCUS_DISTANCE = + new Key("android.lens.focusDistance", float.class); + + /** + *

    + * Whether optical image stabilization is + * enabled. + *

    + *

    + * Will not be supported on most devices. + *

    + * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF + * @see #LENS_OPTICAL_STABILIZATION_MODE_ON + */ + public static final Key LENS_OPTICAL_STABILIZATION_MODE = + new Key("android.lens.opticalStabilizationMode", int.class); + + /** + *

    + * Mode of operation for the noise reduction + * algorithm + *

    + * @see #NOISE_REDUCTION_MODE_OFF + * @see #NOISE_REDUCTION_MODE_FAST + * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY + */ + public static final Key NOISE_REDUCTION_MODE = + new Key("android.noiseReduction.mode", int.class); + + /** + *

    + * An application-specified ID for the current + * request. Must be maintained unchanged in output + * frame + *

    + * + * @hide + */ + public static final Key REQUEST_ID = + new Key("android.request.id", int.class); + + /** + *

    + * (x, y, width, height). + *

    + * A rectangle with the top-level corner of (x,y) and size + * (width, height). The region of the sensor that is used for + * output. Each stream must use this rectangle to produce its + * output, cropping to a smaller region if necessary to + * maintain the stream's aspect ratio. + *

    + * HAL2.x uses only (x, y, width) + *

    + *

    + * Any additional per-stream cropping must be done to + * maximize the final pixel area of the stream. + *

    + * For example, if the crop region is set to a 4:3 aspect + * ratio, then 4:3 streams should use the exact crop + * region. 16:9 streams should further crop vertically + * (letterbox). + *

    + * Conversely, if the crop region is set to a 16:9, then 4:3 + * outputs should crop horizontally (pillarbox), and 16:9 + * streams should match exactly. These additional crops must + * be centered within the crop region. + *

    + * The output streams must maintain square pixels at all + * times, no matter what the relative aspect ratios of the + * crop region and the stream are. Negative values for + * corner are allowed for raw output if full pixel array is + * larger than active pixel array. Width and height may be + * rounded to nearest larger supportable width, especially + * for raw output, where only a few fixed scales may be + * possible. The width and height of the crop region cannot + * be set to be smaller than floor( activeArraySize.width / + * android.scaler.maxDigitalZoom ) and floor( + * activeArraySize.height / android.scaler.maxDigitalZoom), + * respectively. + *

    + */ + public static final Key SCALER_CROP_REGION = + new Key("android.scaler.cropRegion", android.graphics.Rect.class); + + /** + *

    + * Duration each pixel is exposed to + * light + *

    + *

    + * 1/10000 - 30 sec range. No bulb mode + *

    + */ + public static final Key SENSOR_EXPOSURE_TIME = + new Key("android.sensor.exposureTime", long.class); + + /** + *

    + * Duration from start of frame exposure to + * start of next frame exposure + *

    + *

    + * Exposure time has priority, so duration is set to + * max(duration, exposure time + overhead) + *

    + */ + public static final Key SENSOR_FRAME_DURATION = + new Key("android.sensor.frameDuration", long.class); + + /** + *

    + * Gain applied to image data. Must be + * implemented through analog gain only if set to values + * below 'maximum analog sensitivity'. + *

    + *

    + * ISO 12232:2006 REI method + *

    + */ + public static final Key SENSOR_SENSITIVITY = + new Key("android.sensor.sensitivity", int.class); + + /** + *

    + * State of the face detector + * unit + *

    + *

    + * Whether face detection is enabled, and whether it + * should output just the basic fields or the full set of + * fields. Value must be one of the + * android.statistics.info.availableFaceDetectModes. + *

    + * @see #STATISTICS_FACE_DETECT_MODE_OFF + * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE + * @see #STATISTICS_FACE_DETECT_MODE_FULL + */ + public static final Key STATISTICS_FACE_DETECT_MODE = + new Key("android.statistics.faceDetectMode", int.class); + + /** + *

    + * Table mapping blue input values to output + * values + *

    + */ + public static final Key TONEMAP_CURVE_BLUE = + new Key("android.tonemap.curveBlue", float.class); + + /** + *

    + * Table mapping green input values to output + * values + *

    + */ + public static final Key TONEMAP_CURVE_GREEN = + new Key("android.tonemap.curveGreen", float.class); + + /** + *

    + * Table mapping red input values to output + * values + *

    + *

    + * .The input range must be monotonically increasing + * with N, and values between entries should be linearly + * interpolated. For example, if the array is: [0.0, 0.0, + * 0.3, 0.5, 1.0, 1.0], then the input->output mapping + * for a few sample points would be: 0 -> 0, 0.15 -> + * 0.25, 0.3 -> 0.5, 0.5 -> 0.64 + *

    + */ + public static final Key TONEMAP_CURVE_RED = + new Key("android.tonemap.curveRed", float[].class); + + /** + * @see #TONEMAP_MODE_CONTRAST_CURVE + * @see #TONEMAP_MODE_FAST + * @see #TONEMAP_MODE_HIGH_QUALITY + */ + public static final Key TONEMAP_MODE = + new Key("android.tonemap.mode", int.class); + + /** + *

    + * This LED is nominally used to indicate to the user + * that the camera is powered on and may be streaming images back to the + * Application Processor. In certain rare circumstances, the OS may + * disable this when video is processed locally and not transmitted to + * any untrusted applications. + *

    + * In particular, the LED *must* always be on when the data could be + * transmitted off the device. The LED *should* always be on whenever + * data is stored locally on the device. + *

    + * The LED *may* be off if a trusted application is using the data that + * doesn't violate the above rules. + *

    + * + * @hide + */ + public static final Key LED_TRANSMIT = + new Key("android.led.transmit", boolean.class); + + /** + *

    + * Whether black-level compensation is locked + * to its current values, or is free to vary + *

    + *

    + * When set to ON, the values used for black-level + * compensation must not change until the lock is set to + * OFF + *

    + * Since changes to certain capture parameters (such as + * exposure time) may require resetting of black level + * compensation, the HAL must report whether setting the + * black level lock was successful in the output result + * metadata. + *

    + */ + public static final Key BLACK_LEVEL_LOCK = + new Key("android.blackLevel.lock", boolean.class); + + /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * End generated code + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ +} diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index 11c991a8379d..d5bb8b36cd6b 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -34,73 +34,6 @@ import android.graphics.Rect; * */ public final class CaptureResult extends CameraMetadata { - - /** - * The timestamp representing the start of image capture, in nanoseconds. - * This corresponds to the timestamp available through - * {@link android.graphics.SurfaceTexture#getTimestamp SurfaceTexture.getTimestamp()} - * or {@link android.media.Image#getTimestamp Image.getTimestamp()} for this - * capture's image data. - */ - public static final Key SENSOR_TIMESTAMP = - new Key("android.sensor.timestamp", Long.TYPE); - - /** - * The state of the camera device's auto-exposure algorithm. One of the - * CONTROL_AE_STATE_* enumerations. - */ - public static final Key CONTROL_AE_STATE = - new Key("android.control.aeState", Integer.TYPE); - - /** - * The auto-exposure algorithm is inactive. - * @see CONTROL_AE_STATE - */ - public static final int CONTROL_AE_STATE_INACTIVE = 0; - - /** - * The auto-exposure algorithm is currently searching for proper exposure. - * @see CONTROL_AE_STATE - */ - public static final int CONTROL_AE_STATE_SEARCHING = 1; - - /** - * The auto-exposure algorithm has reached proper exposure values for the - * current scene. - * @see CONTROL_AE_STATE - */ - public static final int CONTROL_AE_STATE_CONVERGED = 2; - - /** - * The auto-exposure algorithm has been locked to its current values. - * @see CONTROL_AE_STATE - */ - public static final int CONTROL_AE_STATE_LOCKED = 3; - - /** - * The auto-exposure algorithm has reached proper exposure values as with - * CONTROL_AE_STATE_CONVERGED, but the scene is too dark to take a good - * quality image without firing the camera flash. - * @see CONTROL_AE_STATE - */ - public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; - - /** - * The precapture sequence of the auto-exposure algorithm has been triggered, - * and is underway. - * @see CONTROL_AE_STATE - */ - public static final int CONTROL_AE_STATE_PRECAPTURE =5; - - /** - * The list of faces detected in this capture. Available if face detection - * was enabled for this capture - */ - public static final Key STATISTICS_DETECTED_FACES = - new Key("android.statistics.faces", Face[].class); - - // TODO: Many many more - /** * @hide */ @@ -114,7 +47,7 @@ public final class CaptureResult extends CameraMetadata { /** *

    Bounds of the face. A rectangle relative to the sensor's - * {@link CameraProperties#SENSOR_ACTIVE_ARRAY_SIZE}, with (0,0) + * {@link CameraProperties#SENSOR_INFO_ACTIVE_ARRAY_SIZE}, with (0,0) * representing the top-left corner of the active array rectangle.

    */ public Rect getBounds() { @@ -189,4 +122,807 @@ public final class CaptureResult extends CameraMetadata { private Point mRightEye; private Point mMouth; } + + /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * The key entries below this point are generated from metadata + * definitions in /system/media/camera/docs. Do not modify by hand or + * modify the comment blocks at the start or end. + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ + + /** + *

    + * A color transform matrix to use to transform + * from sensor RGB color space to output linear sRGB color space + *

    + *

    + * This matrix is either set by HAL when the request + * android.colorCorrection.mode is not TRANSFORM_MATRIX, or + * directly by the application in the request when the + * androird.colorCorrection.mode is TRANSFORM_MATRIX. + * In the latter case, the HAL may round the matrix to account + * for precision issues; the final rounded matrix should be + * reported back in this matrix result metadata. + *

    + */ + public static final Key COLOR_CORRECTION_TRANSFORM = + new Key("android.colorCorrection.transform", Rational[].class); + + /** + *

    + * Gains applying to Bayer color channels for + * white-balance + *

    + *

    + * The 4-channel white-balance gains are defined in + * the order of [R G_even G_odd B], where G_even is the gain + * for green pixels on even rows of the output, and G_odd + * is the gain for greenpixels on the odd rows. if a HAL + * does not support a separate gain for even/odd green channels, + * it should use the G_even value,and write G_odd equal to + * G_even in the output result metadata. + *

    + * The ouput should be the gains actually applied by the HAL to + * the current frame. + *

    + */ + public static final Key COLOR_CORRECTION_GAINS = + new Key("android.colorCorrection.gains", float[].class); + + /** + *

    + * The ID sent with the latest + * CAMERA2_TRIGGER_PRECAPTURE_METERING call + *

    + *

    + * Must be 0 if no + * CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet + * by HAL. Always updated even if AE algorithm ignores the + * trigger + *

    + * + * @hide + */ + public static final Key CONTROL_AE_PRECAPTURE_ID = + new Key("android.control.aePrecaptureId", int.class); + + /** + *

    + * List of areas to use for + * metering + *

    + *

    + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + *

    + * The coordinate system is based on the active pixel array, + * with (0,0) being the top-left of the active pixel array, and + * (android.sensor.info.activeArraySize.width, + * android.sensor.info.activeArraySize.height) being the + * bottom-right point of the active pixel array. The weight + * should be nonnegative. + *

    + * If all regions have 0 weight, then no specific metering area + * needs to be used by the HAL. If the metering region is + * outside the current android.scaler.cropRegion, the HAL + * should ignore the sections outside the region and output the + * used sections in the frame metadata + *

    + */ + public static final Key CONTROL_AE_REGIONS = + new Key("android.control.aeRegions", int[].class); + + /** + *

    + * Current state of AE algorithm + *

    + *

    + * Whenever the AE algorithm state changes, a + * MSG_AUTOEXPOSURE notification must be send if a + * notification callback is registered. + *

    + * @see #CONTROL_AE_STATE_INACTIVE + * @see #CONTROL_AE_STATE_SEARCHING + * @see #CONTROL_AE_STATE_CONVERGED + * @see #CONTROL_AE_STATE_LOCKED + * @see #CONTROL_AE_STATE_FLASH_REQUIRED + * @see #CONTROL_AE_STATE_PRECAPTURE + */ + public static final Key CONTROL_AE_STATE = + new Key("android.control.aeState", int.class); + + /** + *

    + * Whether AF is currently enabled, and what + * mode it is set to + *

    + * @see #CONTROL_AF_MODE_OFF + * @see #CONTROL_AF_MODE_AUTO + * @see #CONTROL_AF_MODE_MACRO + * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO + * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE + * @see #CONTROL_AF_MODE_EDOF + */ + public static final Key CONTROL_AF_MODE = + new Key("android.control.afMode", int.class); + + /** + *

    + * List of areas to use for focus + * estimation + *

    + *

    + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + *

    + * The coordinate system is based on the active pixel array, + * with (0,0) being the top-left of the active pixel array, and + * (android.sensor.info.activeArraySize.width, + * android.sensor.info.activeArraySize.height) being the + * bottom-right point of the active pixel array. The weight + * should be nonnegative. + *

    + * If all regions have 0 weight, then no specific focus area + * needs to be used by the HAL. If the focusing region is + * outside the current android.scaler.cropRegion, the HAL + * should ignore the sections outside the region and output the + * used sections in the frame metadata + *

    + */ + public static final Key CONTROL_AF_REGIONS = + new Key("android.control.afRegions", int[].class); + + /** + *

    + * Current state of AF algorithm + *

    + *

    + * Whenever the AF algorithm state changes, a + * MSG_AUTOFOCUS notification must be send if a notification + * callback is registered. + *

    + * @see #CONTROL_AF_STATE_INACTIVE + * @see #CONTROL_AF_STATE_PASSIVE_SCAN + * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED + * @see #CONTROL_AF_STATE_ACTIVE_SCAN + * @see #CONTROL_AF_STATE_FOCUSED_LOCKED + * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED + */ + public static final Key CONTROL_AF_STATE = + new Key("android.control.afState", int.class); + + /** + *

    + * The ID sent with the latest + * CAMERA2_TRIGGER_AUTOFOCUS call + *

    + *

    + * Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger + * received yet by HAL. Always updated even if AF algorithm + * ignores the trigger + *

    + * + * @hide + */ + public static final Key CONTROL_AF_TRIGGER_ID = + new Key("android.control.afTriggerId", int.class); + + /** + *

    + * Whether AWB is currently setting the color + * transform fields, and what its illumination target + * is + *

    + *

    + * [BC - AWB lock,AWB modes] + *

    + * @see #CONTROL_AWB_MODE_OFF + * @see #CONTROL_AWB_MODE_AUTO + * @see #CONTROL_AWB_MODE_INCANDESCENT + * @see #CONTROL_AWB_MODE_FLUORESCENT + * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT + * @see #CONTROL_AWB_MODE_DAYLIGHT + * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT + * @see #CONTROL_AWB_MODE_TWILIGHT + * @see #CONTROL_AWB_MODE_SHADE + */ + public static final Key CONTROL_AWB_MODE = + new Key("android.control.awbMode", int.class); + + /** + *

    + * List of areas to use for illuminant + * estimation + *

    + *

    + * Only used in AUTO mode. + *

    + * Each area is a rectangle plus weight: xmin, ymin, xmax, + * ymax, weight. The coordinate system is based on the active + * pixel array, with (0,0) being the top-left of the active + * pixel array, and (android.sensor.info.activeArraySize.width, + * android.sensor.info.activeArraySize.height) being the + * bottom-right point of the active pixel array. The weight + * should be nonnegative. + *

    + * If all regions have 0 weight, then no specific metering area + * needs to be used by the HAL. If the metering region is + * outside the current android.scaler.cropRegion, the HAL + * should ignore the sections outside the region and output the + * used sections in the frame metadata + *

    + */ + public static final Key CONTROL_AWB_REGIONS = + new Key("android.control.awbRegions", int[].class); + + /** + *

    + * Current state of AWB algorithm + *

    + *

    + * Whenever the AWB algorithm state changes, a + * MSG_AUTOWHITEBALANCE notification must be send if a + * notification callback is registered. + *

    + * @see #CONTROL_AWB_STATE_INACTIVE + * @see #CONTROL_AWB_STATE_SEARCHING + * @see #CONTROL_AWB_STATE_CONVERGED + * @see #CONTROL_AWB_STATE_LOCKED + */ + public static final Key CONTROL_AWB_STATE = + new Key("android.control.awbState", int.class); + + /** + *

    + * Overall mode of 3A control + * routines + *

    + * @see #CONTROL_MODE_OFF + * @see #CONTROL_MODE_AUTO + * @see #CONTROL_MODE_USE_SCENE_MODE + */ + public static final Key CONTROL_MODE = + new Key("android.control.mode", int.class); + + /** + *

    + * Operation mode for edge + * enhancement + *

    + * @see #EDGE_MODE_OFF + * @see #EDGE_MODE_FAST + * @see #EDGE_MODE_HIGH_QUALITY + */ + public static final Key EDGE_MODE = + new Key("android.edge.mode", int.class); + + /** + *

    + * Select flash operation mode + *

    + * @see #FLASH_MODE_OFF + * @see #FLASH_MODE_SINGLE + * @see #FLASH_MODE_TORCH + */ + public static final Key FLASH_MODE = + new Key("android.flash.mode", int.class); + + /** + *

    + * Current state of the flash + * unit + *

    + * @see #FLASH_STATE_UNAVAILABLE + * @see #FLASH_STATE_CHARGING + * @see #FLASH_STATE_READY + * @see #FLASH_STATE_FIRED + */ + public static final Key FLASH_STATE = + new Key("android.flash.state", int.class); + + /** + *

    + * GPS coordinates to include in output JPEG + * EXIF + *

    + */ + public static final Key JPEG_GPS_COORDINATES = + new Key("android.jpeg.gpsCoordinates", double[].class); + + /** + *

    + * 32 characters describing GPS algorithm to + * include in EXIF + *

    + */ + public static final Key JPEG_GPS_PROCESSING_METHOD = + new Key("android.jpeg.gpsProcessingMethod", String.class); + + /** + *

    + * Time GPS fix was made to include in + * EXIF + *

    + */ + public static final Key JPEG_GPS_TIMESTAMP = + new Key("android.jpeg.gpsTimestamp", long.class); + + /** + *

    + * Orientation of JPEG image to + * write + *

    + */ + public static final Key JPEG_ORIENTATION = + new Key("android.jpeg.orientation", int.class); + + /** + *

    + * Compression quality of the final JPEG + * image + *

    + *

    + * 85-95 is typical usage range + *

    + */ + public static final Key JPEG_QUALITY = + new Key("android.jpeg.quality", byte.class); + + /** + *

    + * Compression quality of JPEG + * thumbnail + *

    + */ + public static final Key JPEG_THUMBNAIL_QUALITY = + new Key("android.jpeg.thumbnailQuality", byte.class); + + /** + *

    + * Resolution of embedded JPEG + * thumbnail + *

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

    + * Size of the lens aperture + *

    + *

    + * Will not be supported on most devices. Can only + * pick from supported list + *

    + */ + public static final Key LENS_APERTURE = + new Key("android.lens.aperture", float.class); + + /** + *

    + * State of lens neutral density + * filter(s) + *

    + *

    + * Will not be supported on most devices. Can only + * pick from supported list + *

    + */ + public static final Key LENS_FILTER_DENSITY = + new Key("android.lens.filterDensity", float.class); + + /** + *

    + * Lens optical zoom setting + *

    + *

    + * Will not be supported on most devices. + *

    + */ + public static final Key LENS_FOCAL_LENGTH = + new Key("android.lens.focalLength", float.class); + + /** + *

    + * Distance to plane of sharpest focus, + * measured from frontmost surface of the lens + *

    + *

    + * Should be zero for fixed-focus cameras + *

    + */ + public static final Key LENS_FOCUS_DISTANCE = + new Key("android.lens.focusDistance", float.class); + + /** + *

    + * The range of scene distances that are in + * sharp focus (depth of field) + *

    + *

    + * If variable focus not supported, can still report + * fixed depth of field range + *

    + */ + public static final Key LENS_FOCUS_RANGE = + new Key("android.lens.focusRange", float.class); + + /** + *

    + * Whether optical image stabilization is + * enabled. + *

    + *

    + * Will not be supported on most devices. + *

    + * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF + * @see #LENS_OPTICAL_STABILIZATION_MODE_ON + */ + public static final Key LENS_OPTICAL_STABILIZATION_MODE = + new Key("android.lens.opticalStabilizationMode", int.class); + + /** + *

    + * Current lens status + *

    + * @see #LENS_STATE_STATIONARY + */ + public static final Key LENS_STATE = + new Key("android.lens.state", int.class); + + /** + *

    + * Mode of operation for the noise reduction + * algorithm + *

    + * @see #NOISE_REDUCTION_MODE_OFF + * @see #NOISE_REDUCTION_MODE_FAST + * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY + */ + public static final Key NOISE_REDUCTION_MODE = + new Key("android.noiseReduction.mode", int.class); + + /** + *

    + * Number of frames captured since + * open() + *

    + *

    + * Reset on release() + *

    + */ + public static final Key REQUEST_FRAME_COUNT = + new Key("android.request.frameCount", int.class); + + /** + *

    + * An application-specified ID for the current + * request. Must be maintained unchanged in output + * frame + *

    + * + * @hide + */ + public static final Key REQUEST_ID = + new Key("android.request.id", int.class); + + /** + *

    + * (x, y, width, height). + *

    + * A rectangle with the top-level corner of (x,y) and size + * (width, height). The region of the sensor that is used for + * output. Each stream must use this rectangle to produce its + * output, cropping to a smaller region if necessary to + * maintain the stream's aspect ratio. + *

    + * HAL2.x uses only (x, y, width) + *

    + *

    + * Any additional per-stream cropping must be done to + * maximize the final pixel area of the stream. + *

    + * For example, if the crop region is set to a 4:3 aspect + * ratio, then 4:3 streams should use the exact crop + * region. 16:9 streams should further crop vertically + * (letterbox). + *

    + * Conversely, if the crop region is set to a 16:9, then 4:3 + * outputs should crop horizontally (pillarbox), and 16:9 + * streams should match exactly. These additional crops must + * be centered within the crop region. + *

    + * The output streams must maintain square pixels at all + * times, no matter what the relative aspect ratios of the + * crop region and the stream are. Negative values for + * corner are allowed for raw output if full pixel array is + * larger than active pixel array. Width and height may be + * rounded to nearest larger supportable width, especially + * for raw output, where only a few fixed scales may be + * possible. The width and height of the crop region cannot + * be set to be smaller than floor( activeArraySize.width / + * android.scaler.maxDigitalZoom ) and floor( + * activeArraySize.height / android.scaler.maxDigitalZoom), + * respectively. + *

    + */ + public static final Key SCALER_CROP_REGION = + new Key("android.scaler.cropRegion", android.graphics.Rect.class); + + /** + *

    + * Duration each pixel is exposed to + * light + *

    + *

    + * 1/10000 - 30 sec range. No bulb mode + *

    + */ + public static final Key SENSOR_EXPOSURE_TIME = + new Key("android.sensor.exposureTime", long.class); + + /** + *

    + * Duration from start of frame exposure to + * start of next frame exposure + *

    + *

    + * Exposure time has priority, so duration is set to + * max(duration, exposure time + overhead) + *

    + */ + public static final Key SENSOR_FRAME_DURATION = + new Key("android.sensor.frameDuration", long.class); + + /** + *

    + * Gain applied to image data. Must be + * implemented through analog gain only if set to values + * below 'maximum analog sensitivity'. + *

    + *

    + * ISO 12232:2006 REI method + *

    + */ + public static final Key SENSOR_SENSITIVITY = + new Key("android.sensor.sensitivity", int.class); + + /** + *

    + * Time at start of exposure of first + * row + *

    + *

    + * Monotonic, should be synced to other timestamps in + * system + *

    + */ + public static final Key SENSOR_TIMESTAMP = + new Key("android.sensor.timestamp", long.class); + + /** + *

    + * State of the face detector + * unit + *

    + *

    + * Whether face detection is enabled, and whether it + * should output just the basic fields or the full set of + * fields. Value must be one of the + * android.statistics.info.availableFaceDetectModes. + *

    + * @see #STATISTICS_FACE_DETECT_MODE_OFF + * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE + * @see #STATISTICS_FACE_DETECT_MODE_FULL + */ + public static final Key STATISTICS_FACE_DETECT_MODE = + new Key("android.statistics.faceDetectMode", int.class); + + /** + *

    + * List of unique IDs for detected + * faces + *

    + *

    + * Only available if faceDetectMode == FULL + *

    + */ + public static final Key STATISTICS_FACE_IDS = + new Key("android.statistics.faceIds", int[].class); + + /** + *

    + * List of landmarks for detected + * faces + *

    + *

    + * Only available if faceDetectMode == FULL + *

    + */ + public static final Key STATISTICS_FACE_LANDMARKS = + new Key("android.statistics.faceLandmarks", int[].class); + + /** + *

    + * List of the bounding rectangles for detected + * faces + *

    + *

    + * Only available if faceDetectMode != OFF + *

    + */ + public static final Key STATISTICS_FACE_RECTANGLES = + new Key("android.statistics.faceRectangles", android.graphics.Rect[].class); + + /** + *

    + * List of the face confidence scores for + * detected faces + *

    + *

    + * Only available if faceDetectMode != OFF + *

    + */ + public static final Key STATISTICS_FACE_SCORES = + new Key("android.statistics.faceScores", byte[].class); + + /** + *

    + * A low-resolution map of lens shading, per + * color channel + *

    + *

    + * Assume bilinear interpolation of map. The least + * shaded section of the image should have a gain factor + * of 1; all other sections should have gains above 1. + * the map should be on the order of 30-40 rows, and + * must be smaller than 64x64. + *

    + */ + public static final Key STATISTICS_LENS_SHADING_MAP = + new Key("android.statistics.lensShadingMap", float[].class); + + /** + *

    + * The best-fit color channel gains calculated + * by the HAL's statistics units for the current output frame + *

    + *

    + * This may be different than the gains used for this frame, + * since statistics processing on data from a new frame + * typically completes after the transform has already been + * applied to that frame. + *

    + * The 4 channel gains are defined in Bayer domain, + * see android.colorCorrection.gains for details. + *

    + */ + public static final Key STATISTICS_PREDICTED_COLOR_GAINS = + new Key("android.statistics.predictedColorGains", float[].class); + + /** + *

    + * The best-fit color transform matrix estimate + * calculated by the HAL's statistics units for the current + * output frame + *

    + *

    + * The HAL must provide the estimate from its + * statistics unit on the white balance transforms to use + * for the next frame. These are the values the HAL believes + * are the best fit for the current output frame. This may + * be different than the transform used for this frame, since + * statistics processing on data from a new frame typically + * completes after the transform has already been applied to + * that frame. + *

    + * These estimates must be provided for all frames, even if + * capture settings and color transforms are set by the application. + *

    + */ + public static final Key STATISTICS_PREDICTED_COLOR_TRANSFORM = + new Key("android.statistics.predictedColorTransform", Rational[].class); + + /** + *

    + * The HAL estimated scene illumination lighting + * frequency + *

    + *

    + * Report NONE if there doesn't appear to be flickering + * illumination + *

    + * @see #STATISTICS_SCENE_FLICKER_NONE + * @see #STATISTICS_SCENE_FLICKER_50HZ + * @see #STATISTICS_SCENE_FLICKER_60HZ + */ + public static final Key STATISTICS_SCENE_FLICKER = + new Key("android.statistics.sceneFlicker", int.class); + + /** + *

    + * Table mapping blue input values to output + * values + *

    + */ + public static final Key TONEMAP_CURVE_BLUE = + new Key("android.tonemap.curveBlue", float.class); + + /** + *

    + * Table mapping green input values to output + * values + *

    + */ + public static final Key TONEMAP_CURVE_GREEN = + new Key("android.tonemap.curveGreen", float.class); + + /** + *

    + * Table mapping red input values to output + * values + *

    + *

    + * .The input range must be monotonically increasing + * with N, and values between entries should be linearly + * interpolated. For example, if the array is: [0.0, 0.0, + * 0.3, 0.5, 1.0, 1.0], then the input->output mapping + * for a few sample points would be: 0 -> 0, 0.15 -> + * 0.25, 0.3 -> 0.5, 0.5 -> 0.64 + *

    + */ + public static final Key TONEMAP_CURVE_RED = + new Key("android.tonemap.curveRed", float[].class); + + /** + * @see #TONEMAP_MODE_CONTRAST_CURVE + * @see #TONEMAP_MODE_FAST + * @see #TONEMAP_MODE_HIGH_QUALITY + */ + public static final Key TONEMAP_MODE = + new Key("android.tonemap.mode", int.class); + + /** + *

    + * This LED is nominally used to indicate to the user + * that the camera is powered on and may be streaming images back to the + * Application Processor. In certain rare circumstances, the OS may + * disable this when video is processed locally and not transmitted to + * any untrusted applications. + *

    + * In particular, the LED *must* always be on when the data could be + * transmitted off the device. The LED *should* always be on whenever + * data is stored locally on the device. + *

    + * The LED *may* be off if a trusted application is using the data that + * doesn't violate the above rules. + *

    + * + * @hide + */ + public static final Key LED_TRANSMIT = + new Key("android.led.transmit", boolean.class); + + /** + *

    + * Whether black-level compensation is locked + * to its current values, or is free to vary + *

    + *

    + * When set to ON, the values used for black-level + * compensation must not change until the lock is set to + * OFF + *

    + * Since changes to certain capture parameters (such as + * exposure time) may require resetting of black level + * compensation, the HAL must report whether setting the + * black level lock was successful in the output result + * metadata. + *

    + */ + public static final Key BLACK_LEVEL_LOCK = + new Key("android.blackLevel.lock", boolean.class); + + /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * End generated code + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ } -- cgit v1.2.3-59-g8ed1b