diff options
author | Igor Murashkin <iam@google.com> | 2014-07-15 17:19:49 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2014-07-22 13:10:29 -0700 |
commit | 6c76f58f31635c19c14ae161f96dad2082537860 (patch) | |
tree | 4186607b0cfac5185e4e057487b6b004f3ee2c05 /core/java/android/hardware | |
parent | c79dd82e5578376a87782d648b5cff4a100555b2 (diff) | |
download | frameworks_base-6c76f58f31635c19c14ae161f96dad2082537860.zip frameworks_base-6c76f58f31635c19c14ae161f96dad2082537860.tar.gz frameworks_base-6c76f58f31635c19c14ae161f96dad2082537860.tar.bz2 |
camera2: Add legacy available Request/Result/Characteristics keys
* Also changes the CameraMetadata#get*Keys to not return @hide keys
Change-Id: Ifc89153136a9be502b7b88addbd16a5de68a7bfc
Diffstat (limited to 'core/java/android/hardware')
8 files changed, 448 insertions, 5 deletions
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index a88e659..f18cb7d 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -16,8 +16,9 @@ package android.hardware.camera2; -import android.hardware.camera2.CaptureResult.Key; import android.hardware.camera2.impl.CameraMetadataNative; +import android.hardware.camera2.impl.PublicKey; +import android.hardware.camera2.impl.SyntheticKey; import android.hardware.camera2.utils.TypeReference; import android.util.Rational; @@ -321,6 +322,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_CORRECTION_MODE * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL */ + @PublicKey public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_CORRECTION_MODES = new Key<int[]>("android.colorCorrection.availableAberrationCorrectionModes", int[].class); @@ -332,6 +334,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * valid anti-banding modes that the application may request * for this camera device; they must include AUTO.</p> */ + @PublicKey public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES = new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class); @@ -351,6 +354,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#CONTROL_AE_MODE */ + @PublicKey public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES = new Key<int[]>("android.control.aeAvailableModes", int[].class); @@ -358,6 +362,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>List of frame rate ranges supported by the * auto-exposure (AE) algorithm/hardware</p> */ + @PublicKey public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES = new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }}); @@ -368,6 +373,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP */ + @PublicKey public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE = new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }}); @@ -375,6 +381,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>Smallest step by which exposure compensation * can be changed</p> */ + @PublicKey public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP = new Key<Rational>("android.control.aeCompensationStep", Rational.class); @@ -391,6 +398,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CaptureRequest#CONTROL_AF_MODE * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE */ + @PublicKey public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES = new Key<int[]>("android.control.afAvailableModes", int[].class); @@ -410,6 +418,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CaptureRequest#CONTROL_EFFECT_MODE * @see CaptureRequest#CONTROL_MODE */ + @PublicKey public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS = new Key<int[]>("android.control.availableEffects", int[].class); @@ -424,6 +433,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#CONTROL_SCENE_MODE */ + @PublicKey public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES = new Key<int[]>("android.control.availableSceneModes", int[].class); @@ -431,6 +441,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>List of video stabilization modes that can * be supported</p> */ + @PublicKey public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES = new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class); @@ -450,6 +461,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM * @see CaptureRequest#CONTROL_AWB_MODE */ + @PublicKey public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES = new Key<int[]>("android.control.awbAvailableModes", int[].class); @@ -476,6 +488,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#CONTROL_AE_REGIONS */ + @PublicKey + @SyntheticKey public static final Key<Integer> CONTROL_MAX_REGIONS_AE = new Key<Integer>("android.control.maxRegionsAe", int.class); @@ -487,6 +501,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#CONTROL_AWB_REGIONS */ + @PublicKey + @SyntheticKey public static final Key<Integer> CONTROL_MAX_REGIONS_AWB = new Key<Integer>("android.control.maxRegionsAwb", int.class); @@ -498,6 +514,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#CONTROL_AF_REGIONS */ + @PublicKey + @SyntheticKey public static final Key<Integer> CONTROL_MAX_REGIONS_AF = new Key<Integer>("android.control.maxRegionsAf", int.class); @@ -538,6 +556,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#EDGE_MODE */ + @PublicKey public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES = new Key<int[]>("android.edge.availableEdgeModes", int[].class); @@ -547,6 +566,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>If no flash, none of the flash controls do * anything. All other metadata should return 0.</p> */ + @PublicKey public static final Key<Boolean> FLASH_INFO_AVAILABLE = new Key<Boolean>("android.flash.info.available", boolean.class); @@ -558,6 +578,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#HOT_PIXEL_MODE */ + @PublicKey public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES = new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class); @@ -577,6 +598,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <li>All non (0, 0) sizes will have non-zero widths and heights.</li> * </ul> */ + @PublicKey public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES = new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class); @@ -588,6 +610,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>If the camera device supports variable apertures, the aperture value * in this list will be sorted in ascending order.</p> */ + @PublicKey public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES = new Key<float[]>("android.lens.info.availableApertures", float[].class); @@ -601,6 +624,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#LENS_FILTER_DENSITY */ + @PublicKey public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES = new Key<float[]>("android.lens.info.availableFilterDensities", float[].class); @@ -614,6 +638,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#LENS_FOCAL_LENGTH */ + @PublicKey public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS = new Key<float[]>("android.lens.info.availableFocalLengths", float[].class); @@ -626,6 +651,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE */ + @PublicKey public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION = new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class); @@ -637,6 +663,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION */ + @PublicKey public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE = new Key<Float>("android.lens.info.hyperfocalDistance", float.class); @@ -647,6 +674,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * 0.</p> * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> */ + @PublicKey public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE = new Key<Float>("android.lens.info.minimumFocusDistance", float.class); @@ -674,6 +702,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED */ + @PublicKey public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION = new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class); @@ -683,6 +712,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #LENS_FACING_FRONT * @see #LENS_FACING_BACK */ + @PublicKey public static final Key<Integer> LENS_FACING = new Key<Integer>("android.lens.facing", int.class); @@ -693,6 +723,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#NOISE_REDUCTION_MODE */ + @PublicKey public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES = new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class); @@ -758,6 +789,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP */ + @PublicKey + @SyntheticKey public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW = new Key<Integer>("android.request.maxNumOutputRaw", int.class); @@ -784,6 +817,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP */ + @PublicKey + @SyntheticKey public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC = new Key<Integer>("android.request.maxNumOutputProc", int.class); @@ -804,6 +839,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP */ + @PublicKey + @SyntheticKey public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING = new Key<Integer>("android.request.maxNumOutputProcStalling", int.class); @@ -842,6 +879,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureResult#REQUEST_PIPELINE_DEPTH */ + @PublicKey public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH = new Key<Byte>("android.request.pipelineMaxDepth", byte.class); @@ -862,6 +900,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * partial results.</p> * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> */ + @PublicKey public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT = new Key<Integer>("android.request.partialResultCount", int.class); @@ -892,6 +931,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW */ + @PublicKey public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES = new Key<int[]>("android.request.availableCapabilities", int[].class); @@ -1001,6 +1041,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * than this ratio allows will be rounded up to the minimum * allowed size by the camera device.</p> */ + @PublicKey public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM = new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class); @@ -1360,6 +1401,8 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey + @SyntheticKey public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP = new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class); @@ -1382,6 +1425,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #SCALER_CROPPING_TYPE_CENTER_ONLY * @see #SCALER_CROPPING_TYPE_FREEFORM */ + @PublicKey public static final Key<Integer> SCALER_CROPPING_TYPE = new Key<Integer>("android.scaler.croppingType", int.class); @@ -1391,6 +1435,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>It is smaller or equal to * sensor full pixel array, which could include the black calibration pixels.</p> */ + @PublicKey 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); @@ -1403,6 +1448,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#SENSOR_SENSITIVITY */ + @PublicKey public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE = new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }}); @@ -1416,6 +1462,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB */ + @PublicKey public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT = new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class); @@ -1429,6 +1476,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see CaptureRequest#SENSOR_EXPOSURE_TIME */ + @PublicKey public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE = new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }}); @@ -1449,6 +1497,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see CaptureRequest#SENSOR_FRAME_DURATION */ + @PublicKey public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION = new Key<Long>("android.sensor.info.maxFrameDuration", long.class); @@ -1460,6 +1509,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE */ + @PublicKey public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE = new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class); @@ -1478,6 +1528,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE */ + @PublicKey public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE = new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class); @@ -1495,6 +1546,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN */ + @PublicKey public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL = new Key<Integer>("android.sensor.info.whiteLevel", int.class); @@ -1507,6 +1559,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #SENSOR_INFO_TIMESTAMP_CALIBRATION_UNCALIBRATED * @see #SENSOR_INFO_TIMESTAMP_CALIBRATION_CALIBRATED */ + @PublicKey public static final Key<Integer> SENSOR_INFO_TIMESTAMP_CALIBRATION = new Key<Integer>("android.sensor.info.timestampCalibration", int.class); @@ -1549,6 +1602,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #SENSOR_REFERENCE_ILLUMINANT1_D50 * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN */ + @PublicKey public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 = new Key<Integer>("android.sensor.referenceIlluminant1", int.class); @@ -1569,6 +1623,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2 * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 */ + @PublicKey public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 = new Key<Byte>("android.sensor.referenceIlluminant2", byte.class); @@ -1587,6 +1642,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -1608,6 +1664,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -1630,6 +1687,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -1654,6 +1712,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -1674,6 +1733,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -1696,6 +1756,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -1714,6 +1775,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL */ + @PublicKey public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN = new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class); @@ -1732,6 +1794,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see CaptureRequest#SENSOR_SENSITIVITY */ + @PublicKey public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY = new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class); @@ -1742,6 +1805,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * direction of rolling shutter readout, which is from top * to bottom in the sensor's coordinate system</p> */ + @PublicKey public static final Key<Integer> SENSOR_ORIENTATION = new Key<Integer>("android.sensor.orientation", int.class); @@ -1768,6 +1832,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT */ + @PublicKey public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE = new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }}); @@ -1778,6 +1843,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE */ + @PublicKey public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES = new Key<int[]>("android.sensor.availableTestPatternModes", int[].class); @@ -1792,6 +1858,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * android.statistics.faceIds and * android.statistics.faceLandmarks outputs.</p> */ + @PublicKey public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class); @@ -1799,6 +1866,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <p>The maximum number of simultaneously detectable * faces.</p> */ + @PublicKey public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT = new Key<Integer>("android.statistics.info.maxFaceCount", int.class); @@ -1811,6 +1879,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE */ + @PublicKey public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES = new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class); @@ -1827,6 +1896,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#TONEMAP_CURVE */ + @PublicKey public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS = new Key<Integer>("android.tonemap.maxCurvePoints", int.class); @@ -1838,6 +1908,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * * @see CaptureRequest#TONEMAP_MODE */ + @PublicKey public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES = new Key<int[]>("android.tonemap.availableToneMapModes", int[].class); @@ -1879,6 +1950,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY */ + @PublicKey public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL = new Key<Integer>("android.info.supportedHardwareLevel", int.class); @@ -1917,10 +1989,12 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL * @see #SYNC_MAX_LATENCY_UNKNOWN */ + @PublicKey public static final Key<Integer> SYNC_MAX_LATENCY = new Key<Integer>("android.sync.maxLatency", int.class); /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * End generated code *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ + } diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java index 63130a7..de92451 100644 --- a/core/java/android/hardware/camera2/CameraMetadata.java +++ b/core/java/android/hardware/camera2/CameraMetadata.java @@ -17,6 +17,8 @@ package android.hardware.camera2; import android.hardware.camera2.impl.CameraMetadataNative; +import android.hardware.camera2.impl.PublicKey; +import android.hardware.camera2.impl.SyntheticKey; import android.util.Log; import java.lang.reflect.Field; @@ -151,7 +153,7 @@ public abstract class CameraMetadata<TKey> { } if (instance == null || instance.getProtected(key) != null) { - if (shouldKeyBeAdded(key, filterTags)) { + if (shouldKeyBeAdded(key, field, filterTags)) { keyList.add(key); if (VERBOSE) { @@ -168,7 +170,7 @@ public abstract class CameraMetadata<TKey> { } @SuppressWarnings("rawtypes") - private static <TKey> boolean shouldKeyBeAdded(TKey key, int[] filterTags) { + private static <TKey> boolean shouldKeyBeAdded(TKey key, Field field, int[] filterTags) { if (key == null) { throw new NullPointerException("key must not be null"); } @@ -189,11 +191,27 @@ public abstract class CameraMetadata<TKey> { throw new IllegalArgumentException("key type must be that of a metadata key"); } + if (field.getAnnotation(PublicKey.class) == null) { + // Never expose @hide keys up to the API user + return false; + } + // No filtering necessary if (filterTags == null) { return true; } + if (field.getAnnotation(SyntheticKey.class) != null) { + // This key is synthetic, so calling #getTag will throw IAE + + // TODO: don't just assume all public+synthetic keys are always available + return true; + } + + /* + * Regular key: look up it's native tag and see if it's in filterTags + */ + int keyTag = nativeKey.getTag(); // non-negative result is returned iff the value is in the array diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index 964f4f3..97077e6 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -16,13 +16,13 @@ package android.hardware.camera2; -import android.hardware.camera2.CameraCharacteristics.Key; import android.hardware.camera2.impl.CameraMetadataNative; +import android.hardware.camera2.impl.PublicKey; +import android.hardware.camera2.impl.SyntheticKey; import android.hardware.camera2.utils.HashCodeHelpers; import android.hardware.camera2.utils.TypeReference; import android.os.Parcel; import android.os.Parcelable; -import android.util.Rational; import android.view.Surface; import java.util.Collection; @@ -526,6 +526,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #COLOR_CORRECTION_MODE_FAST * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> COLOR_CORRECTION_MODE = new Key<Integer>("android.colorCorrection.mode", int.class); @@ -544,6 +545,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * * @see CaptureRequest#COLOR_CORRECTION_MODE */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -560,6 +562,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * * @see CaptureRequest#COLOR_CORRECTION_MODE */ + @PublicKey public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class); @@ -583,6 +586,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_FAST * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> COLOR_CORRECTION_ABERRATION_CORRECTION_MODE = new Key<Integer>("android.colorCorrection.aberrationCorrectionMode", int.class); @@ -626,6 +630,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO */ + @PublicKey public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = new Key<Integer>("android.control.aeAntibandingMode", int.class); @@ -654,6 +659,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureRequest#CONTROL_AE_MODE * @see CaptureResult#CONTROL_AE_STATE */ + @PublicKey public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = new Key<Integer>("android.control.aeExposureCompensation", int.class); @@ -680,6 +686,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureRequest#SENSOR_EXPOSURE_TIME * @see CaptureRequest#SENSOR_SENSITIVITY */ + @PublicKey public static final Key<Boolean> CONTROL_AE_LOCK = new Key<Boolean>("android.control.aeLock", boolean.class); @@ -717,6 +724,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE */ + @PublicKey public static final Key<Integer> CONTROL_AE_MODE = new Key<Integer>("android.control.aeMode", int.class); @@ -742,6 +750,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureRequest#SCALER_CROP_REGION * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class); @@ -753,6 +762,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * * @see CaptureRequest#SENSOR_EXPOSURE_TIME */ + @PublicKey public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); @@ -780,6 +790,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START */ + @PublicKey public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = new Key<Integer>("android.control.aePrecaptureTrigger", int.class); @@ -802,6 +813,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE * @see #CONTROL_AF_MODE_EDOF */ + @PublicKey public static final Key<Integer> CONTROL_AF_MODE = new Key<Integer>("android.control.afMode", int.class); @@ -827,6 +839,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureRequest#SCALER_CROP_REGION * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class); @@ -849,6 +862,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_AF_TRIGGER_START * @see #CONTROL_AF_TRIGGER_CANCEL */ + @PublicKey public static final Key<Integer> CONTROL_AF_TRIGGER = new Key<Integer>("android.control.afTrigger", int.class); @@ -861,6 +875,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * * @see CaptureRequest#CONTROL_AWB_MODE */ + @PublicKey public static final Key<Boolean> CONTROL_AWB_LOCK = new Key<Boolean>("android.control.awbLock", boolean.class); @@ -899,6 +914,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_AWB_MODE_TWILIGHT * @see #CONTROL_AWB_MODE_SHADE */ + @PublicKey public static final Key<Integer> CONTROL_AWB_MODE = new Key<Integer>("android.control.awbMode", int.class); @@ -924,6 +940,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureRequest#SCALER_CROP_REGION * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class); @@ -948,6 +965,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG * @see #CONTROL_CAPTURE_INTENT_MANUAL */ + @PublicKey public static final Key<Integer> CONTROL_CAPTURE_INTENT = new Key<Integer>("android.control.captureIntent", int.class); @@ -973,6 +991,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_EFFECT_MODE_BLACKBOARD * @see #CONTROL_EFFECT_MODE_AQUA */ + @PublicKey public static final Key<Integer> CONTROL_EFFECT_MODE = new Key<Integer>("android.control.effectMode", int.class); @@ -1001,6 +1020,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_MODE_USE_SCENE_MODE * @see #CONTROL_MODE_OFF_KEEP_STATE */ + @PublicKey public static final Key<Integer> CONTROL_MODE = new Key<Integer>("android.control.mode", int.class); @@ -1042,6 +1062,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_SCENE_MODE_BARCODE * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO */ + @PublicKey public static final Key<Integer> CONTROL_SCENE_MODE = new Key<Integer>("android.control.sceneMode", int.class); @@ -1066,6 +1087,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON */ + @PublicKey public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = new Key<Integer>("android.control.videoStabilizationMode", int.class); @@ -1086,6 +1108,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #EDGE_MODE_FAST * @see #EDGE_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> EDGE_MODE = new Key<Integer>("android.edge.mode", int.class); @@ -1113,6 +1136,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #FLASH_MODE_SINGLE * @see #FLASH_MODE_TORCH */ + @PublicKey public static final Key<Integer> FLASH_MODE = new Key<Integer>("android.flash.mode", int.class); @@ -1129,12 +1153,15 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #HOT_PIXEL_MODE_FAST * @see #HOT_PIXEL_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> HOT_PIXEL_MODE = new Key<Integer>("android.hotPixel.mode", int.class); /** * <p>A location object to use when generating image GPS metadata.</p> */ + @PublicKey + @SyntheticKey public static final Key<android.location.Location> JPEG_GPS_LOCATION = new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); @@ -1166,6 +1193,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <p>Orientation of JPEG image to * write</p> */ + @PublicKey public static final Key<Integer> JPEG_ORIENTATION = new Key<Integer>("android.jpeg.orientation", int.class); @@ -1174,6 +1202,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * image.</p> * <p>85-95 is typical usage range.</p> */ + @PublicKey public static final Key<Byte> JPEG_QUALITY = new Key<Byte>("android.jpeg.quality", byte.class); @@ -1181,6 +1210,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <p>Compression quality of JPEG * thumbnail.</p> */ + @PublicKey public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); @@ -1197,6 +1227,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * generate the thumbnail image. The thumbnail image will always have a smaller Field * Of View (FOV) than the primary image when aspect ratios differ.</p> */ + @PublicKey public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); @@ -1226,6 +1257,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureRequest#SENSOR_FRAME_DURATION * @see CaptureRequest#SENSOR_SENSITIVITY */ + @PublicKey public static final Key<Float> LENS_APERTURE = new Key<Float>("android.lens.aperture", float.class); @@ -1249,6 +1281,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES * @see CaptureResult#LENS_STATE */ + @PublicKey public static final Key<Float> LENS_FILTER_DENSITY = new Key<Float>("android.lens.filterDensity", float.class); @@ -1268,6 +1301,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureRequest#LENS_FOCUS_DISTANCE * @see CaptureResult#LENS_STATE */ + @PublicKey public static final Key<Float> LENS_FOCAL_LENGTH = new Key<Float>("android.lens.focalLength", float.class); @@ -1285,6 +1319,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE * @see CaptureResult#LENS_STATE */ + @PublicKey public static final Key<Float> LENS_FOCUS_DISTANCE = new Key<Float>("android.lens.focusDistance", float.class); @@ -1314,6 +1349,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF * @see #LENS_OPTICAL_STABILIZATION_MODE_ON */ + @PublicKey public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = new Key<Integer>("android.lens.opticalStabilizationMode", int.class); @@ -1334,6 +1370,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #NOISE_REDUCTION_MODE_FAST * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> NOISE_REDUCTION_MODE = new Key<Integer>("android.noiseReduction.mode", int.class); @@ -1381,6 +1418,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.graphics.Rect> SCALER_CROP_REGION = new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); @@ -1390,6 +1428,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * <p>If the sensor can't expose this exact duration, it should shorten the * duration exposed to the nearest possible value (rather than expose longer).</p> */ + @PublicKey public static final Key<Long> SENSOR_EXPOSURE_TIME = new Key<Long>("android.sensor.exposureTime", long.class); @@ -1468,6 +1507,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP */ + @PublicKey public static final Key<Long> SENSOR_FRAME_DURATION = new Key<Long>("android.sensor.frameDuration", long.class); @@ -1487,6 +1527,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY */ + @PublicKey public static final Key<Integer> SENSOR_SENSITIVITY = new Key<Integer>("android.sensor.sensitivity", int.class); @@ -1503,6 +1544,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE */ + @PublicKey public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = new Key<int[]>("android.sensor.testPatternData", int[].class); @@ -1523,6 +1565,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #SENSOR_TEST_PATTERN_MODE_PN9 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 */ + @PublicKey public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = new Key<Integer>("android.sensor.testPatternMode", int.class); @@ -1561,6 +1604,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #SHADING_MODE_FAST * @see #SHADING_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> SHADING_MODE = new Key<Integer>("android.shading.mode", int.class); @@ -1577,6 +1621,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE * @see #STATISTICS_FACE_DETECT_MODE_FULL */ + @PublicKey public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = new Key<Integer>("android.statistics.faceDetectMode", int.class); @@ -1589,6 +1634,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES */ + @PublicKey public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); @@ -1601,6 +1647,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON */ + @PublicKey public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = new Key<Integer>("android.statistics.lensShadingMapMode", int.class); @@ -1730,6 +1777,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS * @see CaptureRequest#TONEMAP_MODE */ + @PublicKey + @SyntheticKey public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); @@ -1763,6 +1812,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * @see #TONEMAP_MODE_FAST * @see #TONEMAP_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> TONEMAP_MODE = new Key<Integer>("android.tonemap.mode", int.class); @@ -1821,10 +1871,12 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> * other request parameters require a black level recalculation * or reset.</p> */ + @PublicKey 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 956e64f..c9774ed 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -17,6 +17,8 @@ package android.hardware.camera2; import android.hardware.camera2.impl.CameraMetadataNative; +import android.hardware.camera2.impl.PublicKey; +import android.hardware.camera2.impl.SyntheticKey; import android.hardware.camera2.utils.TypeReference; import android.util.Log; import android.util.Rational; @@ -365,6 +367,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #COLOR_CORRECTION_MODE_FAST * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> COLOR_CORRECTION_MODE = new Key<Integer>("android.colorCorrection.mode", int.class); @@ -383,6 +386,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#COLOR_CORRECTION_MODE */ + @PublicKey public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class); @@ -399,6 +403,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#COLOR_CORRECTION_MODE */ + @PublicKey public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class); @@ -422,6 +427,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_FAST * @see #COLOR_CORRECTION_ABERRATION_CORRECTION_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> COLOR_CORRECTION_ABERRATION_CORRECTION_MODE = new Key<Integer>("android.colorCorrection.aberrationCorrectionMode", int.class); @@ -465,6 +471,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO */ + @PublicKey public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = new Key<Integer>("android.control.aeAntibandingMode", int.class); @@ -493,6 +500,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureRequest#CONTROL_AE_MODE * @see CaptureResult#CONTROL_AE_STATE */ + @PublicKey public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = new Key<Integer>("android.control.aeExposureCompensation", int.class); @@ -519,6 +527,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureRequest#SENSOR_EXPOSURE_TIME * @see CaptureRequest#SENSOR_SENSITIVITY */ + @PublicKey public static final Key<Boolean> CONTROL_AE_LOCK = new Key<Boolean>("android.control.aeLock", boolean.class); @@ -556,6 +565,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE */ + @PublicKey public static final Key<Integer> CONTROL_AE_MODE = new Key<Integer>("android.control.aeMode", int.class); @@ -581,6 +591,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureRequest#SCALER_CROP_REGION * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class); @@ -592,6 +603,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#SENSOR_EXPOSURE_TIME */ + @PublicKey public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); @@ -619,6 +631,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START */ + @PublicKey public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = new Key<Integer>("android.control.aePrecaptureTrigger", int.class); @@ -817,6 +830,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AE_STATE_FLASH_REQUIRED * @see #CONTROL_AE_STATE_PRECAPTURE */ + @PublicKey public static final Key<Integer> CONTROL_AE_STATE = new Key<Integer>("android.control.aeState", int.class); @@ -839,6 +853,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE * @see #CONTROL_AF_MODE_EDOF */ + @PublicKey public static final Key<Integer> CONTROL_AF_MODE = new Key<Integer>("android.control.afMode", int.class); @@ -864,6 +879,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureRequest#SCALER_CROP_REGION * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class); @@ -886,6 +902,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AF_TRIGGER_START * @see #CONTROL_AF_TRIGGER_CANCEL */ + @PublicKey public static final Key<Integer> CONTROL_AF_TRIGGER = new Key<Integer>("android.control.afTrigger", int.class); @@ -1283,6 +1300,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED */ + @PublicKey public static final Key<Integer> CONTROL_AF_STATE = new Key<Integer>("android.control.afState", int.class); @@ -1295,6 +1313,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#CONTROL_AWB_MODE */ + @PublicKey public static final Key<Boolean> CONTROL_AWB_LOCK = new Key<Boolean>("android.control.awbLock", boolean.class); @@ -1333,6 +1352,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AWB_MODE_TWILIGHT * @see #CONTROL_AWB_MODE_SHADE */ + @PublicKey public static final Key<Integer> CONTROL_AWB_MODE = new Key<Integer>("android.control.awbMode", int.class); @@ -1358,6 +1378,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureRequest#SCALER_CROP_REGION * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class); @@ -1382,6 +1403,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG * @see #CONTROL_CAPTURE_INTENT_MANUAL */ + @PublicKey public static final Key<Integer> CONTROL_CAPTURE_INTENT = new Key<Integer>("android.control.captureIntent", int.class); @@ -1512,6 +1534,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_AWB_STATE_CONVERGED * @see #CONTROL_AWB_STATE_LOCKED */ + @PublicKey public static final Key<Integer> CONTROL_AWB_STATE = new Key<Integer>("android.control.awbState", int.class); @@ -1537,6 +1560,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_EFFECT_MODE_BLACKBOARD * @see #CONTROL_EFFECT_MODE_AQUA */ + @PublicKey public static final Key<Integer> CONTROL_EFFECT_MODE = new Key<Integer>("android.control.effectMode", int.class); @@ -1565,6 +1589,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_MODE_USE_SCENE_MODE * @see #CONTROL_MODE_OFF_KEEP_STATE */ + @PublicKey public static final Key<Integer> CONTROL_MODE = new Key<Integer>("android.control.mode", int.class); @@ -1606,6 +1631,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_SCENE_MODE_BARCODE * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO */ + @PublicKey public static final Key<Integer> CONTROL_SCENE_MODE = new Key<Integer>("android.control.sceneMode", int.class); @@ -1630,6 +1656,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON */ + @PublicKey public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = new Key<Integer>("android.control.videoStabilizationMode", int.class); @@ -1650,6 +1677,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #EDGE_MODE_FAST * @see #EDGE_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> EDGE_MODE = new Key<Integer>("android.edge.mode", int.class); @@ -1677,6 +1705,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #FLASH_MODE_SINGLE * @see #FLASH_MODE_TORCH */ + @PublicKey public static final Key<Integer> FLASH_MODE = new Key<Integer>("android.flash.mode", int.class); @@ -1694,6 +1723,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #FLASH_STATE_FIRED * @see #FLASH_STATE_PARTIAL */ + @PublicKey public static final Key<Integer> FLASH_STATE = new Key<Integer>("android.flash.state", int.class); @@ -1710,12 +1740,15 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #HOT_PIXEL_MODE_FAST * @see #HOT_PIXEL_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> HOT_PIXEL_MODE = new Key<Integer>("android.hotPixel.mode", int.class); /** * <p>A location object to use when generating image GPS metadata.</p> */ + @PublicKey + @SyntheticKey public static final Key<android.location.Location> JPEG_GPS_LOCATION = new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); @@ -1747,6 +1780,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <p>Orientation of JPEG image to * write</p> */ + @PublicKey public static final Key<Integer> JPEG_ORIENTATION = new Key<Integer>("android.jpeg.orientation", int.class); @@ -1755,6 +1789,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * image.</p> * <p>85-95 is typical usage range.</p> */ + @PublicKey public static final Key<Byte> JPEG_QUALITY = new Key<Byte>("android.jpeg.quality", byte.class); @@ -1762,6 +1797,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <p>Compression quality of JPEG * thumbnail.</p> */ + @PublicKey public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); @@ -1778,6 +1814,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * generate the thumbnail image. The thumbnail image will always have a smaller Field * Of View (FOV) than the primary image when aspect ratios differ.</p> */ + @PublicKey public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); @@ -1807,6 +1844,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureRequest#SENSOR_FRAME_DURATION * @see CaptureRequest#SENSOR_SENSITIVITY */ + @PublicKey public static final Key<Float> LENS_APERTURE = new Key<Float>("android.lens.aperture", float.class); @@ -1830,6 +1868,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES * @see CaptureResult#LENS_STATE */ + @PublicKey public static final Key<Float> LENS_FILTER_DENSITY = new Key<Float>("android.lens.filterDensity", float.class); @@ -1849,6 +1888,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureRequest#LENS_FOCUS_DISTANCE * @see CaptureResult#LENS_STATE */ + @PublicKey public static final Key<Float> LENS_FOCAL_LENGTH = new Key<Float>("android.lens.focalLength", float.class); @@ -1857,6 +1897,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * measured from frontmost surface of the lens.</p> * <p>Should be zero for fixed-focus cameras</p> */ + @PublicKey public static final Key<Float> LENS_FOCUS_DISTANCE = new Key<Float>("android.lens.focusDistance", float.class); @@ -1866,6 +1907,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <p>If variable focus not supported, can still report * fixed depth of field range</p> */ + @PublicKey public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE = new Key<android.util.Pair<Float,Float>>("android.lens.focusRange", new TypeReference<android.util.Pair<Float,Float>>() {{ }}); @@ -1895,6 +1937,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF * @see #LENS_OPTICAL_STABILIZATION_MODE_ON */ + @PublicKey public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = new Key<Integer>("android.lens.opticalStabilizationMode", int.class); @@ -1931,6 +1974,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #LENS_STATE_STATIONARY * @see #LENS_STATE_MOVING */ + @PublicKey public static final Key<Integer> LENS_STATE = new Key<Integer>("android.lens.state", int.class); @@ -1951,6 +1995,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #NOISE_REDUCTION_MODE_FAST * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> NOISE_REDUCTION_MODE = new Key<Integer>("android.noiseReduction.mode", int.class); @@ -1982,6 +2027,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * frameCount value).</p> * <p>Reset on release()</p> */ + @PublicKey public static final Key<Integer> REQUEST_FRAME_COUNT = new Key<Integer>("android.request.frameCount", int.class); @@ -2005,6 +2051,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH */ + @PublicKey public static final Key<Byte> REQUEST_PIPELINE_DEPTH = new Key<Byte>("android.request.pipelineDepth", byte.class); @@ -2043,6 +2090,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<android.graphics.Rect> SCALER_CROP_REGION = new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); @@ -2052,6 +2100,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <p>If the sensor can't expose this exact duration, it should shorten the * duration exposed to the nearest possible value (rather than expose longer).</p> */ + @PublicKey public static final Key<Long> SENSOR_EXPOSURE_TIME = new Key<Long>("android.sensor.exposureTime", long.class); @@ -2130,6 +2179,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP */ + @PublicKey public static final Key<Long> SENSOR_FRAME_DURATION = new Key<Long>("android.sensor.frameDuration", long.class); @@ -2149,6 +2199,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY */ + @PublicKey public static final Key<Integer> SENSOR_SENSITIVITY = new Key<Integer>("android.sensor.sensitivity", int.class); @@ -2171,6 +2222,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_CALIBRATION */ + @PublicKey public static final Key<Long> SENSOR_TIMESTAMP = new Key<Long>("android.sensor.timestamp", long.class); @@ -2185,6 +2237,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * <p>The order of the values is R, G, B; where R is in the lowest index.</p> * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> */ + @PublicKey public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT = new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class); @@ -2222,6 +2275,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * </ul> * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> */ + @PublicKey public static final Key<Float> SENSOR_GREEN_SPLIT = new Key<Float>("android.sensor.greenSplit", float.class); @@ -2238,6 +2292,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE */ + @PublicKey public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = new Key<int[]>("android.sensor.testPatternData", int[].class); @@ -2258,6 +2313,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #SENSOR_TEST_PATTERN_MODE_PN9 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 */ + @PublicKey public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = new Key<Integer>("android.sensor.testPatternMode", int.class); @@ -2272,6 +2328,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ + @PublicKey public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW = new Key<Long>("android.sensor.rollingShutterSkew", long.class); @@ -2310,6 +2367,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #SHADING_MODE_FAST * @see #SHADING_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> SHADING_MODE = new Key<Integer>("android.shading.mode", int.class); @@ -2326,6 +2384,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE * @see #STATISTICS_FACE_DETECT_MODE_FULL */ + @PublicKey public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = new Key<Integer>("android.statistics.faceDetectMode", int.class); @@ -2388,6 +2447,8 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE */ + @PublicKey + @SyntheticKey public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES = new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class); @@ -2434,6 +2495,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#COLOR_CORRECTION_MODE */ + @PublicKey public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP = new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class); @@ -2554,6 +2616,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #STATISTICS_SCENE_FLICKER_50HZ * @see #STATISTICS_SCENE_FLICKER_60HZ */ + @PublicKey public static final Key<Integer> STATISTICS_SCENE_FLICKER = new Key<Integer>("android.statistics.sceneFlicker", int.class); @@ -2566,6 +2629,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES */ + @PublicKey public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); @@ -2581,6 +2645,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE */ + @PublicKey public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP = new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class); @@ -2593,6 +2658,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON */ + @PublicKey public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = new Key<Integer>("android.statistics.lensShadingMapMode", int.class); @@ -2722,6 +2788,8 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS * @see CaptureRequest#TONEMAP_MODE */ + @PublicKey + @SyntheticKey public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); @@ -2755,6 +2823,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * @see #TONEMAP_MODE_FAST * @see #TONEMAP_MODE_HIGH_QUALITY */ + @PublicKey public static final Key<Integer> TONEMAP_MODE = new Key<Integer>("android.tonemap.mode", int.class); @@ -2784,6 +2853,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { * * @see CaptureRequest#BLACK_LEVEL_LOCK */ + @PublicKey public static final Key<Boolean> BLACK_LEVEL_LOCK = new Key<Boolean>("android.blackLevel.lock", boolean.class); @@ -2851,4 +2921,5 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * End generated code *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ + } diff --git a/core/java/android/hardware/camera2/impl/ListenerProxies.java b/core/java/android/hardware/camera2/impl/ListenerProxies.java index 04c43e3..ab9a4d5 100644 --- a/core/java/android/hardware/camera2/impl/ListenerProxies.java +++ b/core/java/android/hardware/camera2/impl/ListenerProxies.java @@ -1,3 +1,18 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package android.hardware.camera2.impl; import android.hardware.camera2.CameraCaptureSession; diff --git a/core/java/android/hardware/camera2/impl/PublicKey.java b/core/java/android/hardware/camera2/impl/PublicKey.java new file mode 100644 index 0000000..d894c1f --- /dev/null +++ b/core/java/android/hardware/camera2/impl/PublicKey.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.camera2.impl; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Denote a static field {@code Key} as being public-visible (in the SDK). + * + * <p>Keys without this annotated are assumed to be {@code @hide}.</p> + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface PublicKey { + +} diff --git a/core/java/android/hardware/camera2/impl/SyntheticKey.java b/core/java/android/hardware/camera2/impl/SyntheticKey.java new file mode 100644 index 0000000..034a049 --- /dev/null +++ b/core/java/android/hardware/camera2/impl/SyntheticKey.java @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.hardware.camera2.impl; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Denote a static field {@code Key} as being synthetic (i.e. not having a native + * tag one-to-one counterpart). + * + * <p>Keys without this annotated are assumed to always have a native counter-part.</p> + * + * <p>In particular a key with a native counter-part will always have it's {@code #getTag} + * method succeed.</p> + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface SyntheticKey { + +} diff --git a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java index 519bbb6..157c159 100644 --- a/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java +++ b/core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java @@ -25,6 +25,7 @@ import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraDevice; import android.hardware.camera2.CameraMetadata; import android.hardware.camera2.CaptureRequest; +import android.hardware.camera2.CaptureResult; import android.hardware.camera2.impl.CameraMetadataNative; import android.hardware.camera2.params.StreamConfiguration; import android.hardware.camera2.params.StreamConfigurationDuration; @@ -444,6 +445,120 @@ public class LegacyMetadataMapper { m.set(REQUEST_AVAILABLE_CAPABILITIES, capabilities); /* + * request.availableCharacteristicsKeys + */ + { + // TODO: check if the underlying key is supported before listing a key as available + + // Note: We only list public keys. Native HALs should list ALL keys regardless of visibility. + + Key<?> availableKeys[] = new Key<?>[] { + CameraCharacteristics.CONTROL_AE_AVAILABLE_ANTIBANDING_MODES , + CameraCharacteristics.CONTROL_AE_AVAILABLE_MODES , + CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES , + CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE , + CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP , + CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES , + CameraCharacteristics.CONTROL_AVAILABLE_EFFECTS , + CameraCharacteristics.CONTROL_AVAILABLE_SCENE_MODES , + CameraCharacteristics.CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES , + CameraCharacteristics.CONTROL_AWB_AVAILABLE_MODES , + CameraCharacteristics.CONTROL_MAX_REGIONS , + CameraCharacteristics.FLASH_INFO_AVAILABLE , + CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL , + CameraCharacteristics.JPEG_AVAILABLE_THUMBNAIL_SIZES , + CameraCharacteristics.LENS_FACING , + CameraCharacteristics.LENS_INFO_AVAILABLE_FOCAL_LENGTHS , + CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES , + CameraCharacteristics.REQUEST_MAX_NUM_OUTPUT_STREAMS , + CameraCharacteristics.REQUEST_PARTIAL_RESULT_COUNT , + CameraCharacteristics.REQUEST_PIPELINE_MAX_DEPTH , + CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM , +// CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP , + CameraCharacteristics.SCALER_CROPPING_TYPE , + CameraCharacteristics.SENSOR_AVAILABLE_TEST_PATTERN_MODES , + CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE , + CameraCharacteristics.SENSOR_INFO_PHYSICAL_SIZE , + CameraCharacteristics.SENSOR_INFO_PIXEL_ARRAY_SIZE , + CameraCharacteristics.SENSOR_ORIENTATION , + CameraCharacteristics.STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES , + CameraCharacteristics.STATISTICS_INFO_MAX_FACE_COUNT , + CameraCharacteristics.SYNC_MAX_LATENCY , + }; + m.set(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, getTagsForKeys(availableKeys)); + } + + /* + * request.availableRequestKeys + */ + { + CaptureRequest.Key<?> availableKeys[] = new CaptureRequest.Key<?>[] { + CaptureRequest.CONTROL_AE_ANTIBANDING_MODE, + CaptureRequest.CONTROL_AE_EXPOSURE_COMPENSATION, + CaptureRequest.CONTROL_AE_LOCK, + CaptureRequest.CONTROL_AE_MODE, + CaptureRequest.CONTROL_AE_REGIONS, + CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE, + CaptureRequest.CONTROL_AF_MODE, + CaptureRequest.CONTROL_AF_REGIONS, + CaptureRequest.CONTROL_AF_TRIGGER, + CaptureRequest.CONTROL_AWB_LOCK, + CaptureRequest.CONTROL_AWB_MODE, + CaptureRequest.CONTROL_CAPTURE_INTENT, + CaptureRequest.CONTROL_EFFECT_MODE, + CaptureRequest.CONTROL_MODE, + CaptureRequest.CONTROL_SCENE_MODE, + CaptureRequest.CONTROL_VIDEO_STABILIZATION_MODE, + CaptureRequest.FLASH_MODE, + CaptureRequest.JPEG_GPS_COORDINATES, + CaptureRequest.JPEG_GPS_PROCESSING_METHOD, + CaptureRequest.JPEG_GPS_TIMESTAMP, + CaptureRequest.JPEG_ORIENTATION, + CaptureRequest.JPEG_QUALITY, + CaptureRequest.JPEG_THUMBNAIL_QUALITY, + CaptureRequest.JPEG_THUMBNAIL_SIZE, + CaptureRequest.LENS_FOCAL_LENGTH, + CaptureRequest.SCALER_CROP_REGION, + CaptureRequest.STATISTICS_FACE_DETECT_MODE, + }; + m.set(REQUEST_AVAILABLE_REQUEST_KEYS, getTagsForKeys(availableKeys)); + } + + /* + * request.availableResultKeys + */ + { + CaptureResult.Key<?> availableKeys[] = new CaptureResult.Key<?>[] { + CaptureResult.CONTROL_AE_ANTIBANDING_MODE , + CaptureResult.CONTROL_AE_EXPOSURE_COMPENSATION , + CaptureResult.CONTROL_AE_LOCK , + CaptureResult.CONTROL_AE_MODE , + CaptureResult.CONTROL_AE_REGIONS , + CaptureResult.CONTROL_AF_MODE , + CaptureResult.CONTROL_AF_REGIONS , + CaptureResult.CONTROL_AF_STATE , + CaptureResult.CONTROL_AWB_MODE , + CaptureResult.CONTROL_AWB_LOCK , + CaptureResult.CONTROL_MODE , + CaptureResult.FLASH_MODE , + CaptureResult.JPEG_GPS_COORDINATES , + CaptureResult.JPEG_GPS_PROCESSING_METHOD , + CaptureResult.JPEG_GPS_TIMESTAMP , + CaptureResult.JPEG_ORIENTATION , + CaptureResult.JPEG_QUALITY , + CaptureResult.JPEG_THUMBNAIL_QUALITY , + CaptureResult.LENS_FOCAL_LENGTH , + CaptureResult.REQUEST_FRAME_COUNT , + CaptureResult.REQUEST_PIPELINE_DEPTH , + CaptureResult.SCALER_CROP_REGION , + CaptureResult.SENSOR_TIMESTAMP , + CaptureResult.STATISTICS_FACE_DETECT_MODE , +// CaptureResult.STATISTICS_FACES , + }; + m.set(REQUEST_AVAILABLE_RESULT_KEYS, getTagsForKeys(availableKeys)); + } + + /* * request.maxNumOutputStreams */ int[] outputStreams = { @@ -649,4 +764,34 @@ public class LegacyMetadataMapper { // TODO: map other request template values return m; } + + private static int[] getTagsForKeys(Key<?>[] keys) { + int[] tags = new int[keys.length]; + + for (int i = 0; i < keys.length; ++i) { + tags[i] = keys[i].getNativeKey().getTag(); + } + + return tags; + } + + private static int[] getTagsForKeys(CaptureRequest.Key<?>[] keys) { + int[] tags = new int[keys.length]; + + for (int i = 0; i < keys.length; ++i) { + tags[i] = keys[i].getNativeKey().getTag(); + } + + return tags; + } + + private static int[] getTagsForKeys(CaptureResult.Key<?>[] keys) { + int[] tags = new int[keys.length]; + + for (int i = 0; i < keys.length; ++i) { + tags[i] = keys[i].getNativeKey().getTag(); + } + + return tags; + } } |