diff options
| -rw-r--r-- | api/current.txt | 253 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CameraDevice.java | 13 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CameraMetadata.java | 1283 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CameraProperties.java | 602 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CaptureRequest.java | 764 | ||||
| -rw-r--r-- | core/java/android/hardware/camera2/CaptureResult.java | 872 |
6 files changed, 3249 insertions, 538 deletions
diff --git a/api/current.txt b/api/current.txt index 6235addaffce..394369511e31 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>, 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 c3b532da5c7b..19b6057a15ee 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}.</li> * - * <li>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 + * <li>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.</li> + * {@link CameraProperties#SCALER_AVAILABLE_JPEG_SIZES jpeg}. Then obtain + * a Surface from it.</li> * * </ul> * 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<T> 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<Field> instanceFields = findInstanceFields(type); - if (instanceFields.size() == 0) { - throw new UnsupportedOperationException("Class has no instance fields: " + type); - } - - int fieldCount = instanceFields.size(); - int bufferSize = 0; - - HashSet<Class<?>> fieldTypes = new HashSet<Class<?>>(); - 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<Object>)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 <T> int packArray(T value, ByteBuffer buffer, Class<T> type, int nativeType, @@ -442,30 +338,6 @@ public class CameraMetadata implements Parcelable, AutoCloseable { return val; } - private static <T> List<Field> findInstanceFields(Class<T> type) { - List<Field> fields = new ArrayList<Field>(); - - 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> T unpackSingle(ByteBuffer buffer, Class<T> type, int nativeType) { @@ -486,84 +358,6 @@ public class CameraMetadata implements Parcelable, AutoCloseable { return instance; } - private static <T> Constructor<T> findApplicableConstructor(Class<T> type) { - - List<Field> instanceFields = findInstanceFields(type); - if (instanceFields.size() == 0) { - throw new UnsupportedOperationException("Class has no instance fields: " + type); - } - - Constructor<T> constructor = null; - int fieldCount = instanceFields.size(); - - HashSet<Class<?>> fieldTypes = new HashSet<Class<?>>(); - 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<T>[] constructors = (Constructor<T>[]) type.getConstructors(); - for (Constructor<T> ctor : constructors) { - Log.v(TAG, String.format("Inspecting constructor '%s'", ctor)); - - Class<?>[] parameterTypes = ctor.getParameterTypes(); - if (parameterTypes.length == fieldCount) { - boolean match = true; - - HashSet<Class<?>> argTypes = new HashSet<Class<?>>(); - 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 extends Enum<T>> T unpackEnum(ByteBuffer buffer, Class<T> type, int nativeType) { int ordinal = unpackSingleNative(buffer, Integer.TYPE, nativeType); @@ -573,55 +367,11 @@ public class CameraMetadata implements Parcelable, AutoCloseable { private static <T> T unpackClass(ByteBuffer buffer, Class<T> type, int nativeType) { MetadataMarshalClass<T> 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<Field> instanceFields = findInstanceFields(type); - if (instanceFields.size() == 0) { - throw new UnsupportedOperationException("Class has no instance fields: " + type); - } - int fieldCount = instanceFields.size(); - - Constructor<T> 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 + // + + /** + * <p> + * android.led.transmit control is used + * </p> + * @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 + // + + /** + * <p> + * Use the android.colorCorrection.transform matrix + * and android.colorCorrection.gains to do color conversion + * </p> + * @see CaptureRequest#COLOR_CORRECTION_MODE + */ + public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0; + + /** + * <p> + * Must not slow down frame rate relative to raw + * bayer output + * </p> + * @see CaptureRequest#COLOR_CORRECTION_MODE + */ + public static final int COLOR_CORRECTION_MODE_FAST = 1; + + /** + * <p> + * Frame rate may be reduced by high + * quality + * </p> + * @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 + // + + /** + * <p> + * Autoexposure is disabled; sensor.exposureTime, + * sensor.sensitivity and sensor.frameDuration are used + * </p> + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_OFF = 0; + + /** + * <p> + * Autoexposure is active, no flash + * control + * </p> + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_ON = 1; + + /** + * <p> + * 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 + * </p> + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2; + + /** + * <p> + * if flash exists Autoexposure is active, auto + * flash control for precapture trigger and always flash + * when captureIntent = STILL_CAPTURE + * </p> + * @see CaptureRequest#CONTROL_AE_MODE + */ + public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3; + + /** + * <p> + * 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 + * </p> + * @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 + // + + /** + * <p> + * The trigger is idle. + * </p> + * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER + */ + public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0; + + /** + * <p> + * The precapture metering sequence + * must be started. The exact effect of the precapture + * trigger depends on the current AE mode and + * state. + * </p> + * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER + */ + public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1; + + // + // Enumeration values for CaptureRequest#CONTROL_AF_MODE + // + + /** + * <p> + * The 3A routines do not control the lens; + * android.lens.focusDistance is controlled by the + * application + * </p> + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_OFF = 0; + + /** + * <p> + * if lens is not fixed focus. + * </p><p> + * 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). + * </p><p> + * Triggering cancel AF resets the lens position to default, + * and sets the AF state to INACTIVE. + * </p> + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_AUTO = 1; + + /** + * <p> + * In this mode, the lens does not move unless the + * autofocus trigger action is called. + * </p><p> + * 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. + * </p> + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_MACRO = 2; + + /** + * <p> + * In this mode, the AF algorithm modifies the lens + * position continually to attempt to provide a + * constantly-in-focus image stream. + * </p><p> + * 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. + * </p><p> + * 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. + * </p> + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3; + + /** + * <p> + * In this mode, the AF algorithm modifies the lens + * position continually to attempt to provide a + * constantly-in-focus image stream. + * </p><p> + * 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. + * </p><p> + * When the AF cancel trigger is activated, the algorithm + * should transition back to INACTIVE and then act as if it + * has just been started. + * </p> + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4; + + /** + * <p> + * Extended depth of field (digital focus). AF + * trigger is ignored, AF state should always be + * INACTIVE. + * </p> + * @see CaptureRequest#CONTROL_AF_MODE + */ + public static final int CONTROL_AF_MODE_EDOF = 5; + + // + // Enumeration values for CaptureRequest#CONTROL_AF_TRIGGER + // + + /** + * <p> + * The trigger is idle. + * </p> + * @see CaptureRequest#CONTROL_AF_TRIGGER + */ + public static final int CONTROL_AF_TRIGGER_IDLE = 0; + + /** + * <p> + * Autofocus must trigger now. + * </p> + * @see CaptureRequest#CONTROL_AF_TRIGGER + */ + public static final int CONTROL_AF_TRIGGER_START = 1; + + /** + * <p> + * Autofocus must return to initial + * state, and cancel any active trigger. + * </p> + * @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 + // + + /** + * <p> + * This request doesn't fall into the other + * categories. Default to preview-like + * behavior. + * </p> + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; + + /** + * <p> + * This request is for a preview-like usecase. The + * precapture trigger may be used to start off a metering + * w/flash sequence + * </p> + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1; + + /** + * <p> + * This request is for a still capture-type + * usecase. + * </p> + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2; + + /** + * <p> + * This request is for a video recording + * usecase. + * </p> + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3; + + /** + * <p> + * This request is for a video snapshot (still + * image while recording video) usecase + * </p> + * @see CaptureRequest#CONTROL_CAPTURE_INTENT + */ + public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4; + + /** + * <p> + * This request is for a ZSL usecase; the + * application will stream full-resolution images and + * reprocess one or several later for a final + * capture + * </p> + * @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 + // + + /** + * <p> + * Full application control of pipeline. All 3A + * routines are disabled, no other settings in + * android.control.* have any effect + * </p> + * @see CaptureRequest#CONTROL_MODE + */ + public static final int CONTROL_MODE_OFF = 0; + + /** + * <p> + * Use settings for each individual 3A routine. + * Manual control of capture parameters is disabled. All + * controls in android.control.* besides sceneMode take + * effect + * </p> + * @see CaptureRequest#CONTROL_MODE + */ + public static final int CONTROL_MODE_AUTO = 1; + + /** + * <p> + * 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 + * </p> + * @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; + + /** + * <p> + * 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). + * </p><p> + * 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 + * </p> + * @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 + // + + /** + * <p> + * No edge enhancement is applied + * </p> + * @see CaptureRequest#EDGE_MODE + */ + public static final int EDGE_MODE_OFF = 0; + + /** + * <p> + * Must not slow down frame rate relative to raw + * bayer output + * </p> + * @see CaptureRequest#EDGE_MODE + */ + public static final int EDGE_MODE_FAST = 1; + + /** + * <p> + * Frame rate may be reduced by high + * quality + * </p> + * @see CaptureRequest#EDGE_MODE + */ + public static final int EDGE_MODE_HIGH_QUALITY = 2; + + // + // Enumeration values for CaptureRequest#FLASH_MODE + // + + /** + * <p> + * Do not fire the flash for this + * capture + * </p> + * @see CaptureRequest#FLASH_MODE + */ + public static final int FLASH_MODE_OFF = 0; + + /** + * <p> + * if android.flash.available is true Fire flash + * for this capture based on firingPower, + * firingTime. + * </p> + * @see CaptureRequest#FLASH_MODE + */ + public static final int FLASH_MODE_SINGLE = 1; + + /** + * <p> + * if android.flash.available is true Flash + * continuously on, power set by + * firingPower + * </p> + * @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 + // + + /** + * <p> + * No noise reduction is applied + * </p> + * @see CaptureRequest#NOISE_REDUCTION_MODE + */ + public static final int NOISE_REDUCTION_MODE_OFF = 0; + + /** + * <p> + * Must not slow down frame rate relative to raw + * bayer output + * </p> + * @see CaptureRequest#NOISE_REDUCTION_MODE + */ + public static final int NOISE_REDUCTION_MODE_FAST = 1; + + /** + * <p> + * May slow down frame rate to provide highest + * quality + * </p> + * @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; + + /** + * <p> + * Optional Return rectangle and confidence + * only + * </p> + * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE + */ + public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1; + + /** + * <p> + * Optional Return all face + * metadata + * </p> + * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE + */ + public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2; + + // + // Enumeration values for CaptureRequest#TONEMAP_MODE + // + + /** + * <p> + * Use the tone mapping curve specified in + * android.tonemap.curve + * </p> + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; + + /** + * <p> + * Must not slow down frame rate relative to raw + * bayer output + * </p> + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_FAST = 1; + + /** + * <p> + * Frame rate may be reduced by high + * quality + * </p> + * @see CaptureRequest#TONEMAP_MODE + */ + public static final int TONEMAP_MODE_HIGH_QUALITY = 2; + + // + // Enumeration values for CaptureResult#CONTROL_AE_STATE + // + + /** + * <p> + * AE is off. When a camera device is opened, it starts in + * this state. + * </p> + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_INACTIVE = 0; + + /** + * <p> + * AE doesn't yet have a good set of control values + * for the current scene + * </p> + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_SEARCHING = 1; + + /** + * <p> + * AE has a good set of control values for the + * current scene + * </p> + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_CONVERGED = 2; + + /** + * <p> + * AE has been locked (aeMode = + * LOCKED) + * </p> + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_LOCKED = 3; + + /** + * <p> + * AE has a good set of control values, but flash + * needs to be fired for good quality still + * capture + * </p> + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; + + /** + * <p> + * 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 + * </p> + * @see CaptureResult#CONTROL_AE_STATE + */ + public static final int CONTROL_AE_STATE_PRECAPTURE = 5; + + // + // Enumeration values for CaptureResult#CONTROL_AF_STATE + // + + /** + * <p> + * AF off or has not yet tried to scan/been asked + * to scan. When a camera device is opened, it starts in + * this state. + * </p> + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_INACTIVE = 0; + + /** + * <p> + * if CONTINUOUS_* modes are supported AF is + * currently doing an AF scan initiated by a continuous + * autofocus mode + * </p> + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1; + + /** + * <p> + * if CONTINUOUS_* modes are supported AF currently + * believes it is in focus, but may restart scanning at + * any time. + * </p> + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2; + + /** + * <p> + * if AUTO or MACRO modes are supported AF is doing + * an AF scan because it was triggered by AF + * trigger + * </p> + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3; + + /** + * <p> + * if any AF mode besides OFF is supported AF + * believes it is focused correctly and is + * locked + * </p> + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4; + + /** + * <p> + * if any AF mode besides OFF is supported AF has + * failed to focus successfully and is + * locked + * </p> + * @see CaptureResult#CONTROL_AF_STATE + */ + public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5; + + // + // Enumeration values for CaptureResult#CONTROL_AWB_STATE + // + + /** + * <p> + * AWB is not in auto mode. When a camera device is opened, it + * starts in this state. + * </p> + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_INACTIVE = 0; + + /** + * <p> + * AWB doesn't yet have a good set of control + * values for the current scene + * </p> + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_SEARCHING = 1; + + /** + * <p> + * AWB has a good set of control values for the + * current scene + * </p> + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_CONVERGED = 2; + + /** + * <p> + * AE has been locked (aeMode = + * LOCKED) + * </p> + * @see CaptureResult#CONTROL_AWB_STATE + */ + public static final int CONTROL_AWB_STATE_LOCKED = 3; + + // + // Enumeration values for CaptureResult#FLASH_STATE + // + + /** + * <p> + * No flash on camera + * </p> + * @see CaptureResult#FLASH_STATE + */ + public static final int FLASH_STATE_UNAVAILABLE = 0; + + /** + * <p> + * if android.flash.available is true Flash is + * charging and cannot be fired + * </p> + * @see CaptureResult#FLASH_STATE + */ + public static final int FLASH_STATE_CHARGING = 1; + + /** + * <p> + * if android.flash.available is true Flash is + * ready to fire + * </p> + * @see CaptureResult#FLASH_STATE + */ + public static final int FLASH_STATE_READY = 2; + + /** + * <p> + * if android.flash.available is true Flash fired + * for this capture + * </p> + * @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. + * <p> + * Which set of antibanding modes are + * supported + * </p> */ - public static final Key<String> INFO_MODEL = - new Key<String>("android.info.model", String.class); + public static final Key<byte[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES = + new Key<byte[]>("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. + * <p> + * List of frame rate ranges supported by the + * AE algorithm/hardware + * </p> */ - public static final Key<String> INFO_IDENTIFIER = - new Key<String>("android.info.identifier", String.class); + public static final Key<int[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES = + new Key<int[]>("android.control.aeAvailableTargetFpsRanges", int[].class); /** - * <p>Whether this camera is removable or not.</p> - * - * <p>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.</p> + * <p> + * Maximum and minimum exposure compensation + * setting, in counts of + * android.control.aeCompensationStepSize + * </p> */ - public static final Key<Boolean> INFO_REMOVABLE = - new Key<Boolean>("android.info.isRemovable", Boolean.TYPE); + public static final Key<int[]> CONTROL_AE_COMPENSATION_RANGE = + new Key<int[]>("android.control.aeCompensationRange", int[].class); /** - * <p>The hardware operational model of this device. One of the - * INFO_SUPPORTED_HARDWARE_LEVEL_* constants.</p> - * - * <p>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.</p> - * - * <p>Specifically, limited-mode devices:</p> - * - * <ol> - * - * <li>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}.</li> - * - * <li>Do not support complete result metadata. Only a few fields are - * provided, such as the timestamp (TODO).</li> - * - * <li>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.</li> - * - * <li>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.</li> - * - * </ol> - * - * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED - * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL + * <p> + * Smallest step by which exposure compensation + * can be changed + * </p> */ - public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL = - new Key<Integer>("android.info.supportedHardwareLevel", Integer.TYPE); + public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP = + new Key<Rational>("android.control.aeCompensationStep", Rational.class); /** - * <p>The type reported by limited-capability camera devices.</p> - * - * <p>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.</p> - * - * <p>Specifically, limited-mode devices:</p> - * - * <ol> - * - * <li>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}.</li> - * - * <li>Do not support complete result metadata. Only a few fields are - * provided, such as the timestamp (TODO).</li> - * - * <li>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.</li> - * - * <li>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.</li> - * - * </ol> - * - * @see #INFO_SUPPORTED_HARDWARE_LEVEL + * <p> + * List of AF modes that can be + * selected + * </p> */ - public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; + public static final Key<byte[]> CONTROL_AF_AVAILABLE_MODES = + new Key<byte[]>("android.control.afAvailableModes", byte[].class); /** - * <p>The type reported by full-capability camera devices</p> - * - * <p>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.</p> - * - * @see #INFO_SUPPORTED_HARDWARE_LEVEL + * <p> + * what subset of the full color effect enum + * list is supported + * </p> */ - public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; + public static final Key<byte[]> CONTROL_AVAILABLE_EFFECTS = + new Key<byte[]>("android.control.availableEffects", byte[].class); /** - * <p>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.</p> - * - * <p>The list is a subset of the formats defined in - * {@link android.graphics.ImageFormat}.</p> - * - * <p>The image formats {@link android.graphics.ImageFormat#JPEG}, - * {@link android.graphics.ImageFormat#YUV_420_888} are guaranteed to be - * supported.</p> + * <p> + * what subset of the scene mode enum list is + * supported. + * </p> + */ + public static final Key<byte[]> CONTROL_AVAILABLE_SCENE_MODES = + new Key<byte[]>("android.control.availableSceneModes", byte[].class); + + /** + * <p> + * List of video stabilization modes that can + * be supported + * </p> + */ + public static final Key<byte[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES = + new Key<byte[]>("android.control.availableVideoStabilizationModes", byte[].class); + + /** + */ + public static final Key<byte[]> CONTROL_AWB_AVAILABLE_MODES = + new Key<byte[]>("android.control.awbAvailableModes", byte[].class); + + /** + * <p> + * For AE, AWB, and AF, how many individual + * regions can be listed for metering? + * </p> + */ + public static final Key<Integer> CONTROL_MAX_REGIONS = + new Key<Integer>("android.control.maxRegions", int.class); + + /** + * <p> + * Whether this camera has a + * flash + * </p> + * <p> + * If no flash, none of the flash controls do + * anything. All other metadata should return 0 + * </p> + */ + public static final Key<Byte> FLASH_INFO_AVAILABLE = + new Key<Byte>("android.flash.info.available", byte.class); + + /** + * <p> + * Supported resolutions for the JPEG + * thumbnail + * </p> + */ + public static final Key<android.hardware.camera2.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES = + new Key<android.hardware.camera2.Size[]>("android.jpeg.availableThumbnailSizes", android.hardware.camera2.Size[].class); + + /** + * <p> + * List of supported aperture + * values + * </p> + * <p> + * If variable aperture not available, only setting + * should be for the fixed aperture + * </p> + */ + public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES = + new Key<float[]>("android.lens.info.availableApertures", float[].class); + + /** + * <p> + * List of supported ND filter + * values + * </p> + * <p> + * 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) + * </p> + */ + public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES = + new Key<float[]>("android.lens.info.availableFilterDensities", float[].class); + + /** + * <p> + * If fitted with optical zoom, what focal + * lengths are available. If not, the static focal + * length + * </p> + * <p> + * If optical zoom not supported, only one value + * should be reported + * </p> + */ + public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS = + new Key<float[]>("android.lens.info.availableFocalLengths", float[].class); + + /** + * <p> + * List of supported optical image + * stabilization modes + * </p> + */ + public static final Key<byte[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION = + new Key<byte[]>("android.lens.info.availableOpticalStabilization", byte[].class); + + /** + * <p> + * Hyperfocal distance for this lens; set to + * 0 if fixed focus + * </p> + * <p> + * The hyperfocal distance is used for the old + * API's 'fixed' setting + * </p> + */ + public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE = + new Key<Float>("android.lens.info.hyperfocalDistance", float.class); + + /** + * <p> + * Shortest distance from frontmost surface + * of the lens that can be focused correctly + * </p> + * <p> + * If the lens is fixed-focus, this should be + * 0 + * </p> + */ + public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE = + new Key<Float>("android.lens.info.minimumFocusDistance", float.class); + + /** + * <p> + * Dimensions of lens shading + * map + * </p> + */ + public static final Key<android.hardware.camera2.Size> LENS_INFO_SHADING_MAP_SIZE = + new Key<android.hardware.camera2.Size>("android.lens.info.shadingMapSize", android.hardware.camera2.Size.class); + + /** + * <p> + * Direction the camera faces relative to + * device screen + * </p> + * @see #LENS_FACING_FRONT + * @see #LENS_FACING_BACK + */ + public static final Key<Integer> LENS_FACING = + new Key<Integer>("android.lens.facing", int.class); + + /** + * <p> + * How many output streams can be allocated at + * the same time for each type of stream + * </p> + * <p> + * Video snapshot with preview callbacks requires 3 + * processed streams (preview, record, app callbacks) and + * one JPEG stream (snapshot) + * </p> + */ + public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS = + new Key<int[]>("android.request.maxNumOutputStreams", int[].class); + + /** + * <p> + * List of app-visible formats + * </p> */ public static final Key<int[]> SCALER_AVAILABLE_FORMATS = new Key<int[]>("android.scaler.availableFormats", int[].class); /** - * <p>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}.</p> + * <p> + * 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 + * </p> + * <p> + * When multiple streams are configured, the minimum + * frame duration will be >= max(individual stream min + * durations) + * </p> */ - public static final Key<Size[]> SCALER_AVAILABLE_JPEG_SIZES = - new Key<Size[]>("android.scaler.availableJpegSizes", Size[].class); + public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS = + new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class); /** - * <p>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.</p> - * - * <p>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. - * - * <p>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}.</p> - * + * <p> + * The resolutions available for output from + * the JPEG block. Listed as width x height + * </p> */ - public static final Key<Size[]> SCALER_AVAILABLE_PROCESSED_SIZES = - new Key<Size[]>("android.scaler.availableProcessedSizes", Size[].class); + public static final Key<android.hardware.camera2.Size[]> SCALER_AVAILABLE_JPEG_SIZES = + new Key<android.hardware.camera2.Size[]>("android.scaler.availableJpegSizes", android.hardware.camera2.Size[].class); /** - * <p>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.</p> - * - * <p>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}.</p> - */ - public static final Key<Size[]> SCALER_AVAILABLE_RAW_SIZES = - new Key<Size[]>("android.scaler.availableRawSizes", Size[].class); - - /** - * <p>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)}.</p> - * - * <p>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.</p> - * - * <p>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.</p> + * <p> + * 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 + * </p> + */ + public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM = + new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class); + + /** + * <p> + * 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 + * </p> + * <p> + * When multiple streams are configured, the minimum + * frame duration will be >= max(individual stream min + * durations) + * </p> + */ + public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS = + new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class); + + /** + * <p> + * 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 + * </p> + */ + public static final Key<android.hardware.camera2.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES = + new Key<android.hardware.camera2.Size[]>("android.scaler.availableProcessedSizes", android.hardware.camera2.Size[].class); + + /** + * <p> + * Area of raw data which corresponds to only + * active pixels; smaller or equal to + * pixelArraySize. + * </p> + */ + public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE = + new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class); + + /** + * <p> + * Range of valid sensitivities + * </p> + */ + public static final Key<int[]> SENSOR_INFO_SENSITIVITY_RANGE = + new Key<int[]>("android.sensor.info.sensitivityRange", int[].class); + + /** + * <p> + * Range of valid exposure + * times + * </p> + */ + public static final Key<long[]> SENSOR_INFO_EXPOSURE_TIME_RANGE = + new Key<long[]>("android.sensor.info.exposureTimeRange", long[].class); + + /** + * <p> + * Maximum possible frame duration (minimum frame + * rate) + * </p> + * <p> + * Minimum duration is a function of resolution, + * processing settings. See + * android.scaler.availableProcessedMinDurations + * android.scaler.availableJpegMinDurations + * android.scaler.availableRawMinDurations + * </p> + */ + public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION = + new Key<Long>("android.sensor.info.maxFrameDuration", long.class); + + /** + * <p> + * The physical dimensions of the full pixel + * array + * </p> + * <p> + * Needed for FOV calculation for old API + * </p> + */ + public static final Key<android.hardware.camera2.Size> SENSOR_INFO_PHYSICAL_SIZE = + new Key<android.hardware.camera2.Size>("android.sensor.info.physicalSize", android.hardware.camera2.Size.class); + + /** + * <p> + * Gain factor from electrons to raw units when + * ISO=100 + * </p> + */ + public static final Key<Rational> SENSOR_BASE_GAIN_FACTOR = + new Key<Rational>("android.sensor.baseGainFactor", Rational.class); + + /** + * <p> + * Maximum sensitivity that is implemented + * purely through analog gain + * </p> + * <p> + * 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 + * </p> + */ + public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY = + new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class); + + /** + * <p> + * 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 + * </p> */ - public static final Key<Rect> SENSOR_ACTIVE_ARRAY_SIZE = - new Key<Rect>("android.sensor.activeArraySize", Rect.class); + public static final Key<Integer> SENSOR_ORIENTATION = + new Key<Integer>("android.sensor.orientation", int.class); /** - * <p>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.</p> + * <p> + * Which face detection modes are available, + * if any + * </p> + * <p> + * OFF means face detection is disabled, it must + * be included in the list. + * </p><p> + * SIMPLE means the device supports the + * android.statistics.faceRectangles and + * android.statistics.faceScores outputs. + * </p><p> + * FULL means the device additionally supports the + * android.statistics.faceIds and + * android.statistics.faceLandmarks outputs. + * </p> */ - public static final Key<Size> SENSOR_PIXEL_ARRAY_SIZE = - new Key<Size>("android.sensor.activeArraySize", Size.class); + public static final Key<byte[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = + new Key<byte[]>("android.statistics.info.availableFaceDetectModes", byte[].class); - // TODO: Many more of these. + /** + * <p> + * Maximum number of simultaneously detectable + * faces + * </p> + */ + public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT = + new Key<Integer>("android.statistics.info.maxFaceCount", int.class); + + /** + * <p> + * Maximum number of supported points in the + * tonemap curve + * </p> + */ + public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS = + new Key<Integer>("android.tonemap.maxCurvePoints", int.class); + + /** + * <p> + * A list of camera LEDs that are available on this system. + * </p> + * @see #LED_AVAILABLE_LEDS_TRANSMIT + * + * @hide + */ + public static final Key<int[]> LED_AVAILABLE_LEDS = + new Key<int[]>("android.led.availableLeds", int[].class); + + /** + * <p> + * 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. + * </p><p> + * For full details refer to "S3. Operational Modes" in camera3.h + * </p> + * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED + * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL + */ + public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL = + new Key<Integer>("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 @@ -55,21 +55,6 @@ public final class CaptureRequest extends CameraMetadata implements Parcelable { private final HashSet<Surface> mSurfaceSet = new HashSet<Surface>(); /** - * The exposure time for this capture, in nanoseconds. - */ - public static final Key<Long> SENSOR_EXPOSURE_TIME = - new Key<Long>("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<Integer> SENSOR_SENSITIVITY = - new Key<Integer>("android.sensor.sensitivity", Integer.TYPE); - - // Many more settings - - /** * @hide */ public CaptureRequest() { @@ -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<Integer> COLOR_CORRECTION_MODE = + new Key<Integer>("android.colorCorrection.mode", int.class); + + /** + * <p> + * A color transform matrix to use to transform + * from sensor RGB color space to output linear sRGB color space + * </p> + * <p> + * 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. + * </p> + */ + public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = + new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); + + /** + * <p> + * Gains applying to Bayer color channels for + * white-balance + * </p> + * <p> + * 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. + * </p><p> + * The ouput should be the gains actually applied by the HAL to + * the current frame. + * </p> + */ + public static final Key<float[]> COLOR_CORRECTION_GAINS = + new Key<float[]>("android.colorCorrection.gains", float[].class); + + /** + * <p> + * Enum for controlling + * antibanding + * </p> + * @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<Integer> CONTROL_AE_ANTIBANDING_MODE = + new Key<Integer>("android.control.aeAntibandingMode", int.class); + + /** + * <p> + * Adjustment to AE target image + * brightness + * </p> + * <p> + * 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 + * </p> + */ + public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = + new Key<Integer>("android.control.aeExposureCompensation", int.class); + + /** + * <p> + * Whether AE is currently locked to its latest + * calculated values + * </p> + * <p> + * 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. + * </p> + */ + public static final Key<Boolean> CONTROL_AE_LOCK = + new Key<Boolean>("android.control.aeLock", boolean.class); + + /** + * <p> + * Whether AE is currently updating the sensor + * exposure and sensitivity fields + * </p> + * <p> + * Only effective if android.control.mode = + * AUTO + * </p> + * @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<Integer> CONTROL_AE_MODE = + new Key<Integer>("android.control.aeMode", int.class); + + /** + * <p> + * List of areas to use for + * metering + * </p> + * <p> + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + * </p><p> + * 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. + * </p><p> + * 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 + * </p> + */ + public static final Key<int[]> CONTROL_AE_REGIONS = + new Key<int[]>("android.control.aeRegions", int[].class); + + /** + * <p> + * Range over which fps can be adjusted to + * maintain exposure + * </p> + * <p> + * Only constrains AE algorithm, not manual control + * of android.sensor.exposureTime + * </p> + */ + public static final Key<int[]> CONTROL_AE_TARGET_FPS_RANGE = + new Key<int[]>("android.control.aeTargetFpsRange", int[].class); + + /** + * <p> + * Whether the HAL must trigger precapture + * metering. + * </p> + * <p> + * 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. + * </p><p> + * The effect of AE precapture trigger depends on the current + * AE mode and state; see the camera HAL device v3 header for + * details. + * </p> + * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE + * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START + */ + public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = + new Key<Integer>("android.control.aePrecaptureTrigger", int.class); + + /** + * <p> + * Whether AF is currently enabled, and what + * mode it is set to + * </p> + * @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<Integer> CONTROL_AF_MODE = + new Key<Integer>("android.control.afMode", int.class); + + /** + * <p> + * List of areas to use for focus + * estimation + * </p> + * <p> + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + * </p><p> + * 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. + * </p><p> + * 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 + * </p> + */ + public static final Key<int[]> CONTROL_AF_REGIONS = + new Key<int[]>("android.control.afRegions", int[].class); + + /** + * <p> + * Whether the HAL must trigger autofocus. + * </p> + * <p> + * This entry is normally set to IDLE, or is not + * included at all in the request settings. + * </p><p> + * 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. + * </p> + * @see #CONTROL_AF_TRIGGER_IDLE + * @see #CONTROL_AF_TRIGGER_START + * @see #CONTROL_AF_TRIGGER_CANCEL + */ + public static final Key<Integer> CONTROL_AF_TRIGGER = + new Key<Integer>("android.control.afTrigger", int.class); + + /** + * <p> + * Whether AWB is currently locked to its + * latest calculated values + * </p> + * <p> + * Note that AWB lock is only meaningful for AUTO + * mode; in other modes, AWB is already fixed to a specific + * setting + * </p> + */ + public static final Key<Boolean> CONTROL_AWB_LOCK = + new Key<Boolean>("android.control.awbLock", boolean.class); + + /** + * <p> + * Whether AWB is currently setting the color + * transform fields, and what its illumination target + * is + * </p> + * <p> + * [BC - AWB lock,AWB modes] + * </p> + * @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<Integer> CONTROL_AWB_MODE = + new Key<Integer>("android.control.awbMode", int.class); + + /** + * <p> + * List of areas to use for illuminant + * estimation + * </p> + * <p> + * Only used in AUTO mode. + * </p><p> + * 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. + * </p><p> + * 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 + * </p> + */ + public static final Key<int[]> CONTROL_AWB_REGIONS = + new Key<int[]>("android.control.awbRegions", int[].class); + + /** + * <p> + * Information to 3A routines about the purpose + * of this capture, to help decide optimal 3A + * strategy + * </p> + * <p> + * Only used if android.control.mode != OFF. + * </p> + * @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<Integer> CONTROL_CAPTURE_INTENT = + new Key<Integer>("android.control.captureIntent", int.class); + + /** + * <p> + * Whether any special color effect is in use. + * Only used if android.control.mode != OFF + * </p> + * @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<Integer> CONTROL_EFFECT_MODE = + new Key<Integer>("android.control.effectMode", int.class); + + /** + * <p> + * Overall mode of 3A control + * routines + * </p> + * @see #CONTROL_MODE_OFF + * @see #CONTROL_MODE_AUTO + * @see #CONTROL_MODE_USE_SCENE_MODE + */ + public static final Key<Integer> CONTROL_MODE = + new Key<Integer>("android.control.mode", int.class); + + /** + * <p> + * Which scene mode is active when + * android.control.mode = SCENE_MODE + * </p> + * @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<Integer> CONTROL_SCENE_MODE = + new Key<Integer>("android.control.sceneMode", int.class); + + /** + * <p> + * Whether video stabilization is + * active + * </p> + * <p> + * If enabled, video stabilization can modify the + * android.scaler.cropRegion to keep the video stream + * stabilized + * </p> + */ + public static final Key<Boolean> CONTROL_VIDEO_STABILIZATION_MODE = + new Key<Boolean>("android.control.videoStabilizationMode", boolean.class); + + /** + * <p> + * Operation mode for edge + * enhancement + * </p> + * @see #EDGE_MODE_OFF + * @see #EDGE_MODE_FAST + * @see #EDGE_MODE_HIGH_QUALITY + */ + public static final Key<Integer> EDGE_MODE = + new Key<Integer>("android.edge.mode", int.class); + + /** + * <p> + * Select flash operation mode + * </p> + * @see #FLASH_MODE_OFF + * @see #FLASH_MODE_SINGLE + * @see #FLASH_MODE_TORCH + */ + public static final Key<Integer> FLASH_MODE = + new Key<Integer>("android.flash.mode", int.class); + + /** + * <p> + * GPS coordinates to include in output JPEG + * EXIF + * </p> + */ + public static final Key<double[]> JPEG_GPS_COORDINATES = + new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); + + /** + * <p> + * 32 characters describing GPS algorithm to + * include in EXIF + * </p> + */ + public static final Key<String> JPEG_GPS_PROCESSING_METHOD = + new Key<String>("android.jpeg.gpsProcessingMethod", String.class); + + /** + * <p> + * Time GPS fix was made to include in + * EXIF + * </p> + */ + public static final Key<Long> JPEG_GPS_TIMESTAMP = + new Key<Long>("android.jpeg.gpsTimestamp", long.class); + + /** + * <p> + * Orientation of JPEG image to + * write + * </p> + */ + public static final Key<Integer> JPEG_ORIENTATION = + new Key<Integer>("android.jpeg.orientation", int.class); + + /** + * <p> + * Compression quality of the final JPEG + * image + * </p> + * <p> + * 85-95 is typical usage range + * </p> + */ + public static final Key<Byte> JPEG_QUALITY = + new Key<Byte>("android.jpeg.quality", byte.class); + + /** + * <p> + * Compression quality of JPEG + * thumbnail + * </p> + */ + public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = + new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); + + /** + * <p> + * Resolution of embedded JPEG + * thumbnail + * </p> + */ + public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE = + new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class); + + /** + * <p> + * Size of the lens aperture + * </p> + * <p> + * Will not be supported on most devices. Can only + * pick from supported list + * </p> + */ + public static final Key<Float> LENS_APERTURE = + new Key<Float>("android.lens.aperture", float.class); + + /** + * <p> + * State of lens neutral density + * filter(s) + * </p> + * <p> + * Will not be supported on most devices. Can only + * pick from supported list + * </p> + */ + public static final Key<Float> LENS_FILTER_DENSITY = + new Key<Float>("android.lens.filterDensity", float.class); + + /** + * <p> + * Lens optical zoom setting + * </p> + * <p> + * Will not be supported on most devices. + * </p> + */ + public static final Key<Float> LENS_FOCAL_LENGTH = + new Key<Float>("android.lens.focalLength", float.class); + + /** + * <p> + * Distance to plane of sharpest focus, + * measured from frontmost surface of the lens + * </p> + * <p> + * 0 = infinity focus. Used value should be clamped + * to (0,minimum focus distance) + * </p> + */ + public static final Key<Float> LENS_FOCUS_DISTANCE = + new Key<Float>("android.lens.focusDistance", float.class); + + /** + * <p> + * Whether optical image stabilization is + * enabled. + * </p> + * <p> + * Will not be supported on most devices. + * </p> + * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF + * @see #LENS_OPTICAL_STABILIZATION_MODE_ON + */ + public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = + new Key<Integer>("android.lens.opticalStabilizationMode", int.class); + + /** + * <p> + * Mode of operation for the noise reduction + * algorithm + * </p> + * @see #NOISE_REDUCTION_MODE_OFF + * @see #NOISE_REDUCTION_MODE_FAST + * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY + */ + public static final Key<Integer> NOISE_REDUCTION_MODE = + new Key<Integer>("android.noiseReduction.mode", int.class); + + /** + * <p> + * An application-specified ID for the current + * request. Must be maintained unchanged in output + * frame + * </p> + * + * @hide + */ + public static final Key<Integer> REQUEST_ID = + new Key<Integer>("android.request.id", int.class); + + /** + * <p> + * (x, y, width, height). + * </p><p> + * 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. + * </p><p> + * HAL2.x uses only (x, y, width) + * </p> + * <p> + * Any additional per-stream cropping must be done to + * maximize the final pixel area of the stream. + * </p><p> + * 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). + * </p><p> + * 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. + * </p><p> + * 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. + * </p> + */ + public static final Key<android.graphics.Rect> SCALER_CROP_REGION = + new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); + + /** + * <p> + * Duration each pixel is exposed to + * light + * </p> + * <p> + * 1/10000 - 30 sec range. No bulb mode + * </p> + */ + public static final Key<Long> SENSOR_EXPOSURE_TIME = + new Key<Long>("android.sensor.exposureTime", long.class); + + /** + * <p> + * Duration from start of frame exposure to + * start of next frame exposure + * </p> + * <p> + * Exposure time has priority, so duration is set to + * max(duration, exposure time + overhead) + * </p> + */ + public static final Key<Long> SENSOR_FRAME_DURATION = + new Key<Long>("android.sensor.frameDuration", long.class); + + /** + * <p> + * Gain applied to image data. Must be + * implemented through analog gain only if set to values + * below 'maximum analog sensitivity'. + * </p> + * <p> + * ISO 12232:2006 REI method + * </p> + */ + public static final Key<Integer> SENSOR_SENSITIVITY = + new Key<Integer>("android.sensor.sensitivity", int.class); + + /** + * <p> + * State of the face detector + * unit + * </p> + * <p> + * 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. + * </p> + * @see #STATISTICS_FACE_DETECT_MODE_OFF + * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE + * @see #STATISTICS_FACE_DETECT_MODE_FULL + */ + public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = + new Key<Integer>("android.statistics.faceDetectMode", int.class); + + /** + * <p> + * Table mapping blue input values to output + * values + * </p> + */ + public static final Key<Float> TONEMAP_CURVE_BLUE = + new Key<Float>("android.tonemap.curveBlue", float.class); + + /** + * <p> + * Table mapping green input values to output + * values + * </p> + */ + public static final Key<Float> TONEMAP_CURVE_GREEN = + new Key<Float>("android.tonemap.curveGreen", float.class); + + /** + * <p> + * Table mapping red input values to output + * values + * </p> + * <p> + * .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 + * </p> + */ + public static final Key<float[]> TONEMAP_CURVE_RED = + new Key<float[]>("android.tonemap.curveRed", float[].class); + + /** + * @see #TONEMAP_MODE_CONTRAST_CURVE + * @see #TONEMAP_MODE_FAST + * @see #TONEMAP_MODE_HIGH_QUALITY + */ + public static final Key<Integer> TONEMAP_MODE = + new Key<Integer>("android.tonemap.mode", int.class); + + /** + * <p> + * 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. + * </p><p> + * 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. + * </p><p> + * The LED *may* be off if a trusted application is using the data that + * doesn't violate the above rules. + * </p> + * + * @hide + */ + public static final Key<Boolean> LED_TRANSMIT = + new Key<Boolean>("android.led.transmit", boolean.class); + + /** + * <p> + * Whether black-level compensation is locked + * to its current values, or is free to vary + * </p> + * <p> + * When set to ON, the values used for black-level + * compensation must not change until the lock is set to + * OFF + * </p><p> + * 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. + * </p> + */ + public static final Key<Boolean> BLACK_LEVEL_LOCK = + new Key<Boolean>("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<Long> SENSOR_TIMESTAMP = - new Key<Long>("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<Integer> CONTROL_AE_STATE = - new Key<Integer>("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<Face[]> STATISTICS_DETECTED_FACES = - new Key<Face[]>("android.statistics.faces", Face[].class); - - // TODO: Many many more - /** * @hide */ @@ -114,7 +47,7 @@ public final class CaptureResult extends CameraMetadata { /** * <p>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.</p> */ 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. + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ + + /** + * <p> + * A color transform matrix to use to transform + * from sensor RGB color space to output linear sRGB color space + * </p> + * <p> + * 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. + * </p> + */ + public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = + new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); + + /** + * <p> + * Gains applying to Bayer color channels for + * white-balance + * </p> + * <p> + * 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. + * </p><p> + * The ouput should be the gains actually applied by the HAL to + * the current frame. + * </p> + */ + public static final Key<float[]> COLOR_CORRECTION_GAINS = + new Key<float[]>("android.colorCorrection.gains", float[].class); + + /** + * <p> + * The ID sent with the latest + * CAMERA2_TRIGGER_PRECAPTURE_METERING call + * </p> + * <p> + * Must be 0 if no + * CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet + * by HAL. Always updated even if AE algorithm ignores the + * trigger + * </p> + * + * @hide + */ + public static final Key<Integer> CONTROL_AE_PRECAPTURE_ID = + new Key<Integer>("android.control.aePrecaptureId", int.class); + + /** + * <p> + * List of areas to use for + * metering + * </p> + * <p> + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + * </p><p> + * 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. + * </p><p> + * 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 + * </p> + */ + public static final Key<int[]> CONTROL_AE_REGIONS = + new Key<int[]>("android.control.aeRegions", int[].class); + + /** + * <p> + * Current state of AE algorithm + * </p> + * <p> + * Whenever the AE algorithm state changes, a + * MSG_AUTOEXPOSURE notification must be send if a + * notification callback is registered. + * </p> + * @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<Integer> CONTROL_AE_STATE = + new Key<Integer>("android.control.aeState", int.class); + + /** + * <p> + * Whether AF is currently enabled, and what + * mode it is set to + * </p> + * @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<Integer> CONTROL_AF_MODE = + new Key<Integer>("android.control.afMode", int.class); + + /** + * <p> + * List of areas to use for focus + * estimation + * </p> + * <p> + * Each area is a rectangle plus weight: xmin, ymin, + * xmax, ymax, weight. + * </p><p> + * 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. + * </p><p> + * 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 + * </p> + */ + public static final Key<int[]> CONTROL_AF_REGIONS = + new Key<int[]>("android.control.afRegions", int[].class); + + /** + * <p> + * Current state of AF algorithm + * </p> + * <p> + * Whenever the AF algorithm state changes, a + * MSG_AUTOFOCUS notification must be send if a notification + * callback is registered. + * </p> + * @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<Integer> CONTROL_AF_STATE = + new Key<Integer>("android.control.afState", int.class); + + /** + * <p> + * The ID sent with the latest + * CAMERA2_TRIGGER_AUTOFOCUS call + * </p> + * <p> + * Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger + * received yet by HAL. Always updated even if AF algorithm + * ignores the trigger + * </p> + * + * @hide + */ + public static final Key<Integer> CONTROL_AF_TRIGGER_ID = + new Key<Integer>("android.control.afTriggerId", int.class); + + /** + * <p> + * Whether AWB is currently setting the color + * transform fields, and what its illumination target + * is + * </p> + * <p> + * [BC - AWB lock,AWB modes] + * </p> + * @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<Integer> CONTROL_AWB_MODE = + new Key<Integer>("android.control.awbMode", int.class); + + /** + * <p> + * List of areas to use for illuminant + * estimation + * </p> + * <p> + * Only used in AUTO mode. + * </p><p> + * 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. + * </p><p> + * 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 + * </p> + */ + public static final Key<int[]> CONTROL_AWB_REGIONS = + new Key<int[]>("android.control.awbRegions", int[].class); + + /** + * <p> + * Current state of AWB algorithm + * </p> + * <p> + * Whenever the AWB algorithm state changes, a + * MSG_AUTOWHITEBALANCE notification must be send if a + * notification callback is registered. + * </p> + * @see #CONTROL_AWB_STATE_INACTIVE + * @see #CONTROL_AWB_STATE_SEARCHING + * @see #CONTROL_AWB_STATE_CONVERGED + * @see #CONTROL_AWB_STATE_LOCKED + */ + public static final Key<Integer> CONTROL_AWB_STATE = + new Key<Integer>("android.control.awbState", int.class); + + /** + * <p> + * Overall mode of 3A control + * routines + * </p> + * @see #CONTROL_MODE_OFF + * @see #CONTROL_MODE_AUTO + * @see #CONTROL_MODE_USE_SCENE_MODE + */ + public static final Key<Integer> CONTROL_MODE = + new Key<Integer>("android.control.mode", int.class); + + /** + * <p> + * Operation mode for edge + * enhancement + * </p> + * @see #EDGE_MODE_OFF + * @see #EDGE_MODE_FAST + * @see #EDGE_MODE_HIGH_QUALITY + */ + public static final Key<Integer> EDGE_MODE = + new Key<Integer>("android.edge.mode", int.class); + + /** + * <p> + * Select flash operation mode + * </p> + * @see #FLASH_MODE_OFF + * @see #FLASH_MODE_SINGLE + * @see #FLASH_MODE_TORCH + */ + public static final Key<Integer> FLASH_MODE = + new Key<Integer>("android.flash.mode", int.class); + + /** + * <p> + * Current state of the flash + * unit + * </p> + * @see #FLASH_STATE_UNAVAILABLE + * @see #FLASH_STATE_CHARGING + * @see #FLASH_STATE_READY + * @see #FLASH_STATE_FIRED + */ + public static final Key<Integer> FLASH_STATE = + new Key<Integer>("android.flash.state", int.class); + + /** + * <p> + * GPS coordinates to include in output JPEG + * EXIF + * </p> + */ + public static final Key<double[]> JPEG_GPS_COORDINATES = + new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); + + /** + * <p> + * 32 characters describing GPS algorithm to + * include in EXIF + * </p> + */ + public static final Key<String> JPEG_GPS_PROCESSING_METHOD = + new Key<String>("android.jpeg.gpsProcessingMethod", String.class); + + /** + * <p> + * Time GPS fix was made to include in + * EXIF + * </p> + */ + public static final Key<Long> JPEG_GPS_TIMESTAMP = + new Key<Long>("android.jpeg.gpsTimestamp", long.class); + + /** + * <p> + * Orientation of JPEG image to + * write + * </p> + */ + public static final Key<Integer> JPEG_ORIENTATION = + new Key<Integer>("android.jpeg.orientation", int.class); + + /** + * <p> + * Compression quality of the final JPEG + * image + * </p> + * <p> + * 85-95 is typical usage range + * </p> + */ + public static final Key<Byte> JPEG_QUALITY = + new Key<Byte>("android.jpeg.quality", byte.class); + + /** + * <p> + * Compression quality of JPEG + * thumbnail + * </p> + */ + public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = + new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); + + /** + * <p> + * Resolution of embedded JPEG + * thumbnail + * </p> + */ + public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE = + new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class); + + /** + * <p> + * Size of the lens aperture + * </p> + * <p> + * Will not be supported on most devices. Can only + * pick from supported list + * </p> + */ + public static final Key<Float> LENS_APERTURE = + new Key<Float>("android.lens.aperture", float.class); + + /** + * <p> + * State of lens neutral density + * filter(s) + * </p> + * <p> + * Will not be supported on most devices. Can only + * pick from supported list + * </p> + */ + public static final Key<Float> LENS_FILTER_DENSITY = + new Key<Float>("android.lens.filterDensity", float.class); + + /** + * <p> + * Lens optical zoom setting + * </p> + * <p> + * Will not be supported on most devices. + * </p> + */ + public static final Key<Float> LENS_FOCAL_LENGTH = + new Key<Float>("android.lens.focalLength", float.class); + + /** + * <p> + * Distance to plane of sharpest focus, + * measured from frontmost surface of the lens + * </p> + * <p> + * Should be zero for fixed-focus cameras + * </p> + */ + public static final Key<Float> LENS_FOCUS_DISTANCE = + new Key<Float>("android.lens.focusDistance", float.class); + + /** + * <p> + * The range of scene distances that are in + * sharp focus (depth of field) + * </p> + * <p> + * If variable focus not supported, can still report + * fixed depth of field range + * </p> + */ + public static final Key<Float> LENS_FOCUS_RANGE = + new Key<Float>("android.lens.focusRange", float.class); + + /** + * <p> + * Whether optical image stabilization is + * enabled. + * </p> + * <p> + * Will not be supported on most devices. + * </p> + * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF + * @see #LENS_OPTICAL_STABILIZATION_MODE_ON + */ + public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = + new Key<Integer>("android.lens.opticalStabilizationMode", int.class); + + /** + * <p> + * Current lens status + * </p> + * @see #LENS_STATE_STATIONARY + */ + public static final Key<Integer> LENS_STATE = + new Key<Integer>("android.lens.state", int.class); + + /** + * <p> + * Mode of operation for the noise reduction + * algorithm + * </p> + * @see #NOISE_REDUCTION_MODE_OFF + * @see #NOISE_REDUCTION_MODE_FAST + * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY + */ + public static final Key<Integer> NOISE_REDUCTION_MODE = + new Key<Integer>("android.noiseReduction.mode", int.class); + + /** + * <p> + * Number of frames captured since + * open() + * </p> + * <p> + * Reset on release() + * </p> + */ + public static final Key<Integer> REQUEST_FRAME_COUNT = + new Key<Integer>("android.request.frameCount", int.class); + + /** + * <p> + * An application-specified ID for the current + * request. Must be maintained unchanged in output + * frame + * </p> + * + * @hide + */ + public static final Key<Integer> REQUEST_ID = + new Key<Integer>("android.request.id", int.class); + + /** + * <p> + * (x, y, width, height). + * </p><p> + * 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. + * </p><p> + * HAL2.x uses only (x, y, width) + * </p> + * <p> + * Any additional per-stream cropping must be done to + * maximize the final pixel area of the stream. + * </p><p> + * 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). + * </p><p> + * 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. + * </p><p> + * 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. + * </p> + */ + public static final Key<android.graphics.Rect> SCALER_CROP_REGION = + new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); + + /** + * <p> + * Duration each pixel is exposed to + * light + * </p> + * <p> + * 1/10000 - 30 sec range. No bulb mode + * </p> + */ + public static final Key<Long> SENSOR_EXPOSURE_TIME = + new Key<Long>("android.sensor.exposureTime", long.class); + + /** + * <p> + * Duration from start of frame exposure to + * start of next frame exposure + * </p> + * <p> + * Exposure time has priority, so duration is set to + * max(duration, exposure time + overhead) + * </p> + */ + public static final Key<Long> SENSOR_FRAME_DURATION = + new Key<Long>("android.sensor.frameDuration", long.class); + + /** + * <p> + * Gain applied to image data. Must be + * implemented through analog gain only if set to values + * below 'maximum analog sensitivity'. + * </p> + * <p> + * ISO 12232:2006 REI method + * </p> + */ + public static final Key<Integer> SENSOR_SENSITIVITY = + new Key<Integer>("android.sensor.sensitivity", int.class); + + /** + * <p> + * Time at start of exposure of first + * row + * </p> + * <p> + * Monotonic, should be synced to other timestamps in + * system + * </p> + */ + public static final Key<Long> SENSOR_TIMESTAMP = + new Key<Long>("android.sensor.timestamp", long.class); + + /** + * <p> + * State of the face detector + * unit + * </p> + * <p> + * 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. + * </p> + * @see #STATISTICS_FACE_DETECT_MODE_OFF + * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE + * @see #STATISTICS_FACE_DETECT_MODE_FULL + */ + public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = + new Key<Integer>("android.statistics.faceDetectMode", int.class); + + /** + * <p> + * List of unique IDs for detected + * faces + * </p> + * <p> + * Only available if faceDetectMode == FULL + * </p> + */ + public static final Key<int[]> STATISTICS_FACE_IDS = + new Key<int[]>("android.statistics.faceIds", int[].class); + + /** + * <p> + * List of landmarks for detected + * faces + * </p> + * <p> + * Only available if faceDetectMode == FULL + * </p> + */ + public static final Key<int[]> STATISTICS_FACE_LANDMARKS = + new Key<int[]>("android.statistics.faceLandmarks", int[].class); + + /** + * <p> + * List of the bounding rectangles for detected + * faces + * </p> + * <p> + * Only available if faceDetectMode != OFF + * </p> + */ + public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = + new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); + + /** + * <p> + * List of the face confidence scores for + * detected faces + * </p> + * <p> + * Only available if faceDetectMode != OFF + * </p> + */ + public static final Key<byte[]> STATISTICS_FACE_SCORES = + new Key<byte[]>("android.statistics.faceScores", byte[].class); + + /** + * <p> + * A low-resolution map of lens shading, per + * color channel + * </p> + * <p> + * 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. + * </p> + */ + public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = + new Key<float[]>("android.statistics.lensShadingMap", float[].class); + + /** + * <p> + * The best-fit color channel gains calculated + * by the HAL's statistics units for the current output frame + * </p> + * <p> + * 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. + * </p><p> + * The 4 channel gains are defined in Bayer domain, + * see android.colorCorrection.gains for details. + * </p> + */ + public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = + new Key<float[]>("android.statistics.predictedColorGains", float[].class); + + /** + * <p> + * The best-fit color transform matrix estimate + * calculated by the HAL's statistics units for the current + * output frame + * </p> + * <p> + * 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. + * </p><p> + * These estimates must be provided for all frames, even if + * capture settings and color transforms are set by the application. + * </p> + */ + public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = + new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); + + /** + * <p> + * The HAL estimated scene illumination lighting + * frequency + * </p> + * <p> + * Report NONE if there doesn't appear to be flickering + * illumination + * </p> + * @see #STATISTICS_SCENE_FLICKER_NONE + * @see #STATISTICS_SCENE_FLICKER_50HZ + * @see #STATISTICS_SCENE_FLICKER_60HZ + */ + public static final Key<Integer> STATISTICS_SCENE_FLICKER = + new Key<Integer>("android.statistics.sceneFlicker", int.class); + + /** + * <p> + * Table mapping blue input values to output + * values + * </p> + */ + public static final Key<Float> TONEMAP_CURVE_BLUE = + new Key<Float>("android.tonemap.curveBlue", float.class); + + /** + * <p> + * Table mapping green input values to output + * values + * </p> + */ + public static final Key<Float> TONEMAP_CURVE_GREEN = + new Key<Float>("android.tonemap.curveGreen", float.class); + + /** + * <p> + * Table mapping red input values to output + * values + * </p> + * <p> + * .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 + * </p> + */ + public static final Key<float[]> TONEMAP_CURVE_RED = + new Key<float[]>("android.tonemap.curveRed", float[].class); + + /** + * @see #TONEMAP_MODE_CONTRAST_CURVE + * @see #TONEMAP_MODE_FAST + * @see #TONEMAP_MODE_HIGH_QUALITY + */ + public static final Key<Integer> TONEMAP_MODE = + new Key<Integer>("android.tonemap.mode", int.class); + + /** + * <p> + * 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. + * </p><p> + * 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. + * </p><p> + * The LED *may* be off if a trusted application is using the data that + * doesn't violate the above rules. + * </p> + * + * @hide + */ + public static final Key<Boolean> LED_TRANSMIT = + new Key<Boolean>("android.led.transmit", boolean.class); + + /** + * <p> + * Whether black-level compensation is locked + * to its current values, or is free to vary + * </p> + * <p> + * When set to ON, the values used for black-level + * compensation must not change until the lock is set to + * OFF + * </p><p> + * 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. + * </p> + */ + public static final Key<Boolean> BLACK_LEVEL_LOCK = + new Key<Boolean>("android.blackLevel.lock", boolean.class); + + /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ + * End generated code + *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ } |