Merge "Camera: Move bokeh mode to extendedSceneMode tag" into rvc-dev am: 2ecb17aa03

Change-Id: I35b8e47abdd0f1fdb07d37d34fdc38ac565abf04
This commit is contained in:
TreeHugger Robot
2020-03-21 04:40:13 +00:00
committed by Automerger Merge Worker
7 changed files with 176 additions and 154 deletions

View File

@@ -17230,8 +17230,8 @@ package android.hardware.camera2 {
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Rational> CONTROL_AE_COMPENSATION_STEP; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.util.Rational> CONTROL_AE_COMPENSATION_STEP;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> CONTROL_AE_LOCK_AVAILABLE; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Boolean> CONTROL_AE_LOCK_AVAILABLE;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AF_AVAILABLE_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AF_AVAILABLE_MODES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.Capability[]> CONTROL_AVAILABLE_BOKEH_CAPABILITIES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_EFFECTS; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_EFFECTS;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.hardware.camera2.params.Capability[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_MODES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_SCENE_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_SCENE_MODES;
field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES;
@@ -17452,9 +17452,6 @@ package android.hardware.camera2 {
field public static final int CONTROL_AWB_STATE_INACTIVE = 0; // 0x0 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_LOCKED = 3; // 0x3
field public static final int CONTROL_AWB_STATE_SEARCHING = 1; // 0x1 field public static final int CONTROL_AWB_STATE_SEARCHING = 1; // 0x1
field public static final int CONTROL_BOKEH_MODE_CONTINUOUS = 2; // 0x2
field public static final int CONTROL_BOKEH_MODE_OFF = 0; // 0x0
field public static final int CONTROL_BOKEH_MODE_STILL_CAPTURE = 1; // 0x1
field public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; // 0x0 field public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; // 0x0
field public static final int CONTROL_CAPTURE_INTENT_MANUAL = 6; // 0x6 field public static final int CONTROL_CAPTURE_INTENT_MANUAL = 6; // 0x6
field public static final int CONTROL_CAPTURE_INTENT_MOTION_TRACKING = 7; // 0x7 field public static final int CONTROL_CAPTURE_INTENT_MOTION_TRACKING = 7; // 0x7
@@ -17472,9 +17469,13 @@ package android.hardware.camera2 {
field public static final int CONTROL_EFFECT_MODE_SEPIA = 4; // 0x4 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_SOLARIZE = 3; // 0x3
field public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6; // 0x6 field public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6; // 0x6
field public static final int CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS = 2; // 0x2
field public static final int CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE = 1; // 0x1
field public static final int CONTROL_EXTENDED_SCENE_MODE_DISABLED = 0; // 0x0
field public static final int CONTROL_MODE_AUTO = 1; // 0x1 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_OFF = 0; // 0x0
field public static final int CONTROL_MODE_OFF_KEEP_STATE = 3; // 0x3 field public static final int CONTROL_MODE_OFF_KEEP_STATE = 3; // 0x3
field public static final int CONTROL_MODE_USE_EXTENDED_SCENE_MODE = 4; // 0x4
field public static final int CONTROL_MODE_USE_SCENE_MODE = 2; // 0x2 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_ACTION = 2; // 0x2
field public static final int CONTROL_SCENE_MODE_BARCODE = 16; // 0x10 field public static final int CONTROL_SCENE_MODE_BARCODE = 16; // 0x10
@@ -17666,10 +17667,10 @@ package android.hardware.camera2 {
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_AWB_LOCK; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_AWB_LOCK;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AWB_MODE; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_AWB_MODE;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_BOKEH_MODE;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_CAPTURE_INTENT; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_CAPTURE_INTENT;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_EFFECT_MODE; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_EFFECT_MODE;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_EXTENDED_SCENE_MODE;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_MODE; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_MODE;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST;
field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_SCENE_MODE; field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> CONTROL_SCENE_MODE;
@@ -17753,10 +17754,10 @@ package android.hardware.camera2 {
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AWB_MODE; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AWB_MODE;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AWB_STATE; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_AWB_STATE;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_BOKEH_MODE;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_CAPTURE_INTENT; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_CAPTURE_INTENT;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_EFFECT_MODE; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_EFFECT_MODE;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_EXTENDED_SCENE_MODE;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_MODE; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_MODE;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST;
field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_SCENE_MODE; field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> CONTROL_SCENE_MODE;

View File

@@ -1125,42 +1125,43 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }}); new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});
/** /**
* <p>The list of bokeh modes for {@link CaptureRequest#CONTROL_BOKEH_MODE android.control.bokehMode} that are supported by this camera * <p>The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that are supported
* device, and each bokeh mode's maximum streaming (non-stall) size with bokeh effect.</p> * by this camera device, and each extended scene mode's maximum streaming (non-stall) size
* <p>For OFF mode, the camera behaves normally with no bokeh effect.</p> * with effect.</p>
* <p>For STILL_CAPTURE mode, the maximum streaming dimension specifies the limit under which * <p>For DISABLED mode, the camera behaves normally with no extended scene mode enabled.</p>
* bokeh is effective when capture intent is PREVIEW. Note that when capture intent is * <p>For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
* PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE intent * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
* in order to maintain reasonable frame rate. The maximum streaming dimension must be one * intent is PREVIEW, the bokeh effect may not be as high in quality compared to
* of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or (0, 0) * STILL_CAPTURE intent in order to maintain reasonable frame rate. The maximum streaming
* if preview bokeh is not supported. If the application configures a stream larger than * dimension must be one of the YUV_420_888 or PRIVATE resolutions in
* the maximum streaming dimension, bokeh effect may not be applied for this stream for * availableStreamConfigurations, or (0, 0) if preview bokeh is not supported. If the
* PREVIEW intent.</p> * application configures a stream larger than the maximum streaming dimension, bokeh
* <p>For CONTINUOUS mode, the maximum streaming dimension specifies the limit under which * effect may not be applied for this stream for PREVIEW intent.</p>
* bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE resolutions * <p>For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
* in availableStreamConfigurations, and if the sensor maximum resolution is larger than or * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
* equal to 1080p, the maximum streaming dimension must be at least 1080p. If the * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
* application configures a stream with larger dimension, the stream may not have bokeh * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
* effect applied.</p> * If the application configures a stream with larger dimension, the stream may not have
* bokeh effect applied.</p>
* <p><b>Units</b>: (mode, width, height)</p> * <p><b>Units</b>: (mode, width, height)</p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
* <p><b>Limited capability</b> - * <p><b>Limited capability</b> -
* Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
* {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
* *
* @see CaptureRequest#CONTROL_BOKEH_MODE * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
* @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
* @hide * @hide
*/ */
public static final Key<int[]> CONTROL_AVAILABLE_BOKEH_MAX_SIZES = public static final Key<int[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES =
new Key<int[]>("android.control.availableBokehMaxSizes", int[].class); new Key<int[]>("android.control.availableExtendedSceneModeMaxSizes", int[].class);
/** /**
* <p>The ranges of supported zoom ratio for non-OFF {@link CaptureRequest#CONTROL_BOKEH_MODE android.control.bokehMode}.</p> * <p>The ranges of supported zoom ratio for non-DISABLED {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode}.</p>
* <p>When bokeh mode is enabled, the camera device may have limited range of zoom ratios * <p>When extended scene mode is set, the camera device may have limited range of zoom ratios
* compared to when bokeh mode is disabled. This tag lists the zoom ratio ranges for all * compared to when extended scene mode is DISABLED. This tag lists the zoom ratio ranges
* supported non-OFF bokeh modes, in the same order as in * for all supported non-DISABLED extended scene modes, in the same order as in
* {@link CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES android.control.availableBokehCapabilities}.</p> * android.control.availableExtended.</p>
* <p>Range [1.0, 1.0] means that no zoom (optical or digital) is supported.</p> * <p>Range [1.0, 1.0] means that no zoom (optical or digital) is supported.</p>
* <p><b>Units</b>: (minZoom, maxZoom)</p> * <p><b>Units</b>: (minZoom, maxZoom)</p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
@@ -1168,46 +1169,45 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
* Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
* {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
* *
* @see CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
* @see CaptureRequest#CONTROL_BOKEH_MODE
* @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
* @hide * @hide
*/ */
public static final Key<float[]> CONTROL_AVAILABLE_BOKEH_ZOOM_RATIO_RANGES = public static final Key<float[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES =
new Key<float[]>("android.control.availableBokehZoomRatioRanges", float[].class); new Key<float[]>("android.control.availableExtendedSceneModeZoomRatioRanges", float[].class);
/** /**
* <p>The list of bokeh modes for {@link CaptureRequest#CONTROL_BOKEH_MODE android.control.bokehMode} that are supported by * <p>The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that
* this camera device, and each bokeh mode's capabilities such as maximum streaming size * are supported by this camera device, and each extended scene mode's capabilities such
* with bokeh effect, and supported zoom ratio ranges.</p> * as maximum streaming size, and supported zoom ratio ranges.</p>
* <p>For OFF mode, the camera behaves normally with no bokeh effect.</p> * <p>For DISABLED mode, the camera behaves normally with no extended scene mdoe enabled.</p>
* <p>For STILL_CAPTURE mode, the maximum streaming dimension specifies the limit under which * <p>For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
* bokeh is effective when capture intent is PREVIEW. Note that when capture intent is * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
* PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE intent * intent is PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE
* in order to maintain reasonable frame rate. The maximum streaming dimension must be one * intent in order to maintain reasonable frame rate. The maximum streaming dimension must
* of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or (0, 0) * be one of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or
* if preview bokeh is not supported. If the application configures a stream larger than * (0, 0) if preview bokeh is not supported. If the application configures a stream
* the maximum streaming dimension, bokeh effect may not be applied for this stream for * larger than the maximum streaming dimension, bokeh effect may not be applied for this
* PREVIEW intent.</p> * stream for PREVIEW intent.</p>
* <p>For CONTINUOUS mode, the maximum streaming dimension specifies the limit under which * <p>For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
* bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE resolutions * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
* in availableStreamConfigurations, and if the sensor maximum resolution is larger than or * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
* equal to 1080p, the maximum streaming dimension must be at least 1080p. If the * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
* application configures a stream with larger dimension, the stream may not have bokeh * If the application configures a stream with larger dimension, the stream may not have
* effect applied.</p> * bokeh effect applied.</p>
* <p>When bokeh mode is enabled, the camera device may have limited range of zoom ratios * <p>When extended scene mode is set, the camera device may have limited range of zoom ratios
* compared to when bokeh mode is disabled. availableBokehCapabilities lists the zoom * compared to when the mode is DISABLED. availableExtendedSceneModeCapabilities lists the
* ranges for all supported bokeh modes. A range of (1.0, 1.0) means that no zoom * zoom ranges for all supported extended modes. A range of (1.0, 1.0) means that no zoom
* (optical or digital) is supported.</p> * (optical or digital) is supported.</p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
* *
* @see CaptureRequest#CONTROL_BOKEH_MODE * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
*/ */
@PublicKey @PublicKey
@NonNull @NonNull
@SyntheticKey @SyntheticKey
public static final Key<android.hardware.camera2.params.Capability[]> CONTROL_AVAILABLE_BOKEH_CAPABILITIES = public static final Key<android.hardware.camera2.params.Capability[]> CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES =
new Key<android.hardware.camera2.params.Capability[]>("android.control.availableBokehCapabilities", android.hardware.camera2.params.Capability[].class); new Key<android.hardware.camera2.params.Capability[]>("android.control.availableExtendedSceneModeCapabilities", android.hardware.camera2.params.Capability[].class);
/** /**
* <p>Minimum and maximum zoom ratios supported by this camera device.</p> * <p>Minimum and maximum zoom ratios supported by this camera device.</p>

View File

@@ -2190,6 +2190,7 @@ public abstract class CameraMetadata<TKey> {
* This setting can only be used if scene mode is supported (i.e. * This setting can only be used if scene mode is supported (i.e.
* {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes} * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}
* contain some modes other than DISABLED).</p> * contain some modes other than DISABLED).</p>
* <p>For extended scene modes such as BOKEH, please use USE_EXTENDED_SCENE_MODE instead.</p>
* *
* @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
* @see CaptureRequest#CONTROL_MODE * @see CaptureRequest#CONTROL_MODE
@@ -2209,6 +2210,19 @@ public abstract class CameraMetadata<TKey> {
*/ */
public static final int CONTROL_MODE_OFF_KEEP_STATE = 3; public static final int CONTROL_MODE_OFF_KEEP_STATE = 3;
/**
* <p>Use a specific extended scene mode.</p>
* <p>When extended scene mode is on, the camera device may override certain control
* parameters, such as targetFpsRange, AE, AWB, and AF modes, to achieve best power and
* quality tradeoffs. Only the mandatory stream combinations of LIMITED hardware level
* are guaranteed.</p>
* <p>This setting can only be used if extended scene mode is supported (i.e.
* android.control.availableExtendedSceneModes
* contains some modes other than DISABLED).</p>
* @see CaptureRequest#CONTROL_MODE
*/
public static final int CONTROL_MODE_USE_EXTENDED_SCENE_MODE = 4;
// //
// Enumeration values for CaptureRequest#CONTROL_SCENE_MODE // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE
// //
@@ -2540,32 +2554,39 @@ public abstract class CameraMetadata<TKey> {
public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1; public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1;
// //
// Enumeration values for CaptureRequest#CONTROL_BOKEH_MODE // Enumeration values for CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
// //
/** /**
* <p>Bokeh mode is disabled.</p> * <p>Extended scene mode is disabled.</p>
* @see CaptureRequest#CONTROL_BOKEH_MODE * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
*/ */
public static final int CONTROL_BOKEH_MODE_OFF = 0; public static final int CONTROL_EXTENDED_SCENE_MODE_DISABLED = 0;
/** /**
* <p>High quality bokeh mode is enabled for all non-raw streams (including YUV, * <p>High quality bokeh mode is enabled for all non-raw streams (including YUV,
* JPEG, and IMPLEMENTATION_DEFINED) when capture intent is STILL_CAPTURE. Due to the * JPEG, and IMPLEMENTATION_DEFINED) when capture intent is STILL_CAPTURE. Due to the
* extra image processing, this mode may introduce additional stall to non-raw streams. * extra image processing, this mode may introduce additional stall to non-raw streams.
* This mode should be used in high quality still capture use case.</p> * This mode should be used in high quality still capture use case.</p>
* @see CaptureRequest#CONTROL_BOKEH_MODE * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
*/ */
public static final int CONTROL_BOKEH_MODE_STILL_CAPTURE = 1; public static final int CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE = 1;
/** /**
* <p>Bokeh effect must not slow down capture rate relative to sensor raw output, * <p>Bokeh effect must not slow down capture rate relative to sensor raw output,
* and the effect is applied to all processed streams no larger than the maximum * and the effect is applied to all processed streams no larger than the maximum
* streaming dimension. This mode should be used if performance and power are a * streaming dimension. This mode should be used if performance and power are a
* priority, such as video recording.</p> * priority, such as video recording.</p>
* @see CaptureRequest#CONTROL_BOKEH_MODE * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
*/ */
public static final int CONTROL_BOKEH_MODE_CONTINUOUS = 2; public static final int CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS = 2;
/**
* <p>Vendor defined extended scene modes. These depend on vendor implementation.</p>
* @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE
* @hide
*/
public static final int CONTROL_EXTENDED_SCENE_MODE_VENDOR_START = 0x40;
// //
// Enumeration values for CaptureRequest#EDGE_MODE // Enumeration values for CaptureRequest#EDGE_MODE

View File

@@ -1911,10 +1911,10 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* capture parameters itself.</p> * capture parameters itself.</p>
* <p>When set to AUTO, the individual algorithm controls in * <p>When set to AUTO, the individual algorithm controls in
* android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
* <p>When set to USE_SCENE_MODE, the individual controls in * <p>When set to USE_SCENE_MODE or USE_EXTENDED_SCENE_MODE, the individual controls in
* android.control.* are mostly disabled, and the camera device * android.control.* are mostly disabled, and the camera device
* implements one of the scene mode settings (such as ACTION, * implements one of the scene mode or extended scene mode settings (such as ACTION,
* SUNSET, or PARTY) as it wishes. The camera device scene mode * SUNSET, PARTY, or BOKEH) as it wishes. The camera device scene mode
* 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p> * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
* <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
* is that this frame will not be used by camera device background 3A statistics * is that this frame will not be used by camera device background 3A statistics
@@ -1927,6 +1927,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* <li>{@link #CONTROL_MODE_AUTO AUTO}</li> * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
* <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
* <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
* <li>{@link #CONTROL_MODE_USE_EXTENDED_SCENE_MODE USE_EXTENDED_SCENE_MODE}</li>
* </ul></p> * </ul></p>
* <p><b>Available values for this device:</b><br> * <p><b>Available values for this device:</b><br>
* {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
@@ -1938,6 +1939,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
* @see #CONTROL_MODE_AUTO * @see #CONTROL_MODE_AUTO
* @see #CONTROL_MODE_USE_SCENE_MODE * @see #CONTROL_MODE_USE_SCENE_MODE
* @see #CONTROL_MODE_OFF_KEEP_STATE * @see #CONTROL_MODE_OFF_KEEP_STATE
* @see #CONTROL_MODE_USE_EXTENDED_SCENE_MODE
*/ */
@PublicKey @PublicKey
@NonNull @NonNull
@@ -2127,52 +2129,49 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
new Key<Boolean>("android.control.enableZsl", boolean.class); new Key<Boolean>("android.control.enableZsl", boolean.class);
/** /**
* <p>Whether bokeh mode is enabled for a particular capture request.</p> * <p>Whether extended scene mode is enabled for a particular capture request.</p>
* <p>With bokeh mode, the camera device may blur out the parts of scene that are not in * <p>With bokeh mode, the camera device may blur out the parts of scene that are not in
* focus, creating a bokeh (or shallow depth of field) effect for people or objects.</p> * focus, creating a bokeh (or shallow depth of field) effect for people or objects.</p>
* <p>When set to STILL_CAPTURE bokeh mode with STILL_CAPTURE capture intent, due to the extra * <p>When set to BOKEH_STILL_CAPTURE mode with STILL_CAPTURE capture intent, due to the extra
* processing needed for high quality bokeh effect, the stall may be longer than when * processing needed for high quality bokeh effect, the stall may be longer than when
* capture intent is not STILL_CAPTURE.</p> * capture intent is not STILL_CAPTURE.</p>
* <p>When set to STILL_CAPTURE bokeh mode with PREVIEW capture intent,</p> * <p>When set to BOKEH_STILL_CAPTURE mode with PREVIEW capture intent,</p>
* <ul> * <ul>
* <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of * <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of
* BURST_CAPTURE must still be met.</li> * BURST_CAPTURE must still be met.</li>
* <li>All streams not larger than the maximum streaming dimension for STILL_CAPTURE mode * <li>All streams not larger than the maximum streaming dimension for BOKEH_STILL_CAPTURE mode
* (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES }) * (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES })
* will have preview bokeh effect applied.</li> * will have preview bokeh effect applied.</li>
* </ul> * </ul>
* <p>When set to CONTINUOUS mode, configured streams dimension should not exceed this mode's * <p>When set to BOKEH_CONTINUOUS mode, configured streams dimension should not exceed this mode's
* maximum streaming dimension in order to have bokeh effect applied. Bokeh effect may not * maximum streaming dimension in order to have bokeh effect applied. Bokeh effect may not
* be available for streams larger than the maximum streaming dimension.</p> * be available for streams larger than the maximum streaming dimension.</p>
* <p>Switching between different bokeh modes may involve reconfiguration of the camera * <p>Switching between different extended scene modes may involve reconfiguration of the camera
* pipeline, resulting in long latency. The application should check this key against the * pipeline, resulting in long latency. The application should check this key against the
* available session keys queried via * available session keys queried via
* {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</p> * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</p>
* <p>When bokeh mode is on, the camera device may override certain control parameters, such as
* reduce frame rate or use face priority scene mode, to achieve best power and quality
* tradeoffs. When turned on, AE, AWB, and AF run in auto modes, and only the mandatory
* stream combinations of LIMITED hardware level are guaranteed.</p>
* <p>For a logical multi-camera, bokeh may be implemented by stereo vision from sub-cameras * <p>For a logical multi-camera, bokeh may be implemented by stereo vision from sub-cameras
* with different field of view. As a result, when bokeh mode is enabled, the camera device * with different field of view. As a result, when bokeh mode is enabled, the camera device
* may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, and the field of view will be smaller than when * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, and the field of
* bokeh mode is off.</p> * view may be smaller than when bokeh mode is off.</p>
* <p><b>Possible values:</b> * <p><b>Possible values:</b>
* <ul> * <ul>
* <li>{@link #CONTROL_BOKEH_MODE_OFF OFF}</li> * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_DISABLED DISABLED}</li>
* <li>{@link #CONTROL_BOKEH_MODE_STILL_CAPTURE STILL_CAPTURE}</li> * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE BOKEH_STILL_CAPTURE}</li>
* <li>{@link #CONTROL_BOKEH_MODE_CONTINUOUS CONTINUOUS}</li> * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS BOKEH_CONTINUOUS}</li>
* </ul></p> * </ul></p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
* *
* @see CaptureRequest#CONTROL_ZOOM_RATIO
* @see CaptureRequest#SCALER_CROP_REGION * @see CaptureRequest#SCALER_CROP_REGION
* @see #CONTROL_BOKEH_MODE_OFF * @see #CONTROL_EXTENDED_SCENE_MODE_DISABLED
* @see #CONTROL_BOKEH_MODE_STILL_CAPTURE * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE
* @see #CONTROL_BOKEH_MODE_CONTINUOUS * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS
*/ */
@PublicKey @PublicKey
@NonNull @NonNull
public static final Key<Integer> CONTROL_BOKEH_MODE = public static final Key<Integer> CONTROL_EXTENDED_SCENE_MODE =
new Key<Integer>("android.control.bokehMode", int.class); new Key<Integer>("android.control.extendedSceneMode", int.class);
/** /**
* <p>The desired zoom ratio</p> * <p>The desired zoom ratio</p>

View File

@@ -2118,10 +2118,10 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* capture parameters itself.</p> * capture parameters itself.</p>
* <p>When set to AUTO, the individual algorithm controls in * <p>When set to AUTO, the individual algorithm controls in
* android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
* <p>When set to USE_SCENE_MODE, the individual controls in * <p>When set to USE_SCENE_MODE or USE_EXTENDED_SCENE_MODE, the individual controls in
* android.control.* are mostly disabled, and the camera device * android.control.* are mostly disabled, and the camera device
* implements one of the scene mode settings (such as ACTION, * implements one of the scene mode or extended scene mode settings (such as ACTION,
* SUNSET, or PARTY) as it wishes. The camera device scene mode * SUNSET, PARTY, or BOKEH) as it wishes. The camera device scene mode
* 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p> * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p>
* <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
* is that this frame will not be used by camera device background 3A statistics * is that this frame will not be used by camera device background 3A statistics
@@ -2134,6 +2134,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* <li>{@link #CONTROL_MODE_AUTO AUTO}</li> * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
* <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
* <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
* <li>{@link #CONTROL_MODE_USE_EXTENDED_SCENE_MODE USE_EXTENDED_SCENE_MODE}</li>
* </ul></p> * </ul></p>
* <p><b>Available values for this device:</b><br> * <p><b>Available values for this device:</b><br>
* {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
@@ -2145,6 +2146,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
* @see #CONTROL_MODE_AUTO * @see #CONTROL_MODE_AUTO
* @see #CONTROL_MODE_USE_SCENE_MODE * @see #CONTROL_MODE_USE_SCENE_MODE
* @see #CONTROL_MODE_OFF_KEEP_STATE * @see #CONTROL_MODE_OFF_KEEP_STATE
* @see #CONTROL_MODE_USE_EXTENDED_SCENE_MODE
*/ */
@PublicKey @PublicKey
@NonNull @NonNull
@@ -2357,52 +2359,49 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
new Key<Integer>("android.control.afSceneChange", int.class); new Key<Integer>("android.control.afSceneChange", int.class);
/** /**
* <p>Whether bokeh mode is enabled for a particular capture request.</p> * <p>Whether extended scene mode is enabled for a particular capture request.</p>
* <p>With bokeh mode, the camera device may blur out the parts of scene that are not in * <p>With bokeh mode, the camera device may blur out the parts of scene that are not in
* focus, creating a bokeh (or shallow depth of field) effect for people or objects.</p> * focus, creating a bokeh (or shallow depth of field) effect for people or objects.</p>
* <p>When set to STILL_CAPTURE bokeh mode with STILL_CAPTURE capture intent, due to the extra * <p>When set to BOKEH_STILL_CAPTURE mode with STILL_CAPTURE capture intent, due to the extra
* processing needed for high quality bokeh effect, the stall may be longer than when * processing needed for high quality bokeh effect, the stall may be longer than when
* capture intent is not STILL_CAPTURE.</p> * capture intent is not STILL_CAPTURE.</p>
* <p>When set to STILL_CAPTURE bokeh mode with PREVIEW capture intent,</p> * <p>When set to BOKEH_STILL_CAPTURE mode with PREVIEW capture intent,</p>
* <ul> * <ul>
* <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of * <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of
* BURST_CAPTURE must still be met.</li> * BURST_CAPTURE must still be met.</li>
* <li>All streams not larger than the maximum streaming dimension for STILL_CAPTURE mode * <li>All streams not larger than the maximum streaming dimension for BOKEH_STILL_CAPTURE mode
* (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES }) * (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES })
* will have preview bokeh effect applied.</li> * will have preview bokeh effect applied.</li>
* </ul> * </ul>
* <p>When set to CONTINUOUS mode, configured streams dimension should not exceed this mode's * <p>When set to BOKEH_CONTINUOUS mode, configured streams dimension should not exceed this mode's
* maximum streaming dimension in order to have bokeh effect applied. Bokeh effect may not * maximum streaming dimension in order to have bokeh effect applied. Bokeh effect may not
* be available for streams larger than the maximum streaming dimension.</p> * be available for streams larger than the maximum streaming dimension.</p>
* <p>Switching between different bokeh modes may involve reconfiguration of the camera * <p>Switching between different extended scene modes may involve reconfiguration of the camera
* pipeline, resulting in long latency. The application should check this key against the * pipeline, resulting in long latency. The application should check this key against the
* available session keys queried via * available session keys queried via
* {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</p> * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.</p>
* <p>When bokeh mode is on, the camera device may override certain control parameters, such as
* reduce frame rate or use face priority scene mode, to achieve best power and quality
* tradeoffs. When turned on, AE, AWB, and AF run in auto modes, and only the mandatory
* stream combinations of LIMITED hardware level are guaranteed.</p>
* <p>For a logical multi-camera, bokeh may be implemented by stereo vision from sub-cameras * <p>For a logical multi-camera, bokeh may be implemented by stereo vision from sub-cameras
* with different field of view. As a result, when bokeh mode is enabled, the camera device * with different field of view. As a result, when bokeh mode is enabled, the camera device
* may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, and the field of view will be smaller than when * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, and the field of
* bokeh mode is off.</p> * view may be smaller than when bokeh mode is off.</p>
* <p><b>Possible values:</b> * <p><b>Possible values:</b>
* <ul> * <ul>
* <li>{@link #CONTROL_BOKEH_MODE_OFF OFF}</li> * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_DISABLED DISABLED}</li>
* <li>{@link #CONTROL_BOKEH_MODE_STILL_CAPTURE STILL_CAPTURE}</li> * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE BOKEH_STILL_CAPTURE}</li>
* <li>{@link #CONTROL_BOKEH_MODE_CONTINUOUS CONTINUOUS}</li> * <li>{@link #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS BOKEH_CONTINUOUS}</li>
* </ul></p> * </ul></p>
* <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p> * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
* *
* @see CaptureRequest#CONTROL_ZOOM_RATIO
* @see CaptureRequest#SCALER_CROP_REGION * @see CaptureRequest#SCALER_CROP_REGION
* @see #CONTROL_BOKEH_MODE_OFF * @see #CONTROL_EXTENDED_SCENE_MODE_DISABLED
* @see #CONTROL_BOKEH_MODE_STILL_CAPTURE * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE
* @see #CONTROL_BOKEH_MODE_CONTINUOUS * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS
*/ */
@PublicKey @PublicKey
@NonNull @NonNull
public static final Key<Integer> CONTROL_BOKEH_MODE = public static final Key<Integer> CONTROL_EXTENDED_SCENE_MODE =
new Key<Integer>("android.control.bokehMode", int.class); new Key<Integer>("android.control.extendedSceneMode", int.class);
/** /**
* <p>The desired zoom ratio</p> * <p>The desired zoom ratio</p>

View File

@@ -714,12 +714,12 @@ public class CameraMetadataNative implements Parcelable {
} }
}); });
sGetCommandMap.put( sGetCommandMap.put(
CameraCharacteristics.CONTROL_AVAILABLE_BOKEH_CAPABILITIES.getNativeKey(), CameraCharacteristics.CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES.getNativeKey(),
new GetCommand() { new GetCommand() {
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> T getValue(CameraMetadataNative metadata, Key<T> key) { public <T> T getValue(CameraMetadataNative metadata, Key<T> key) {
return (T) metadata.getBokehCapabilities(); return (T) metadata.getExtendedSceneModeCapabilities();
} }
}); });
} }
@@ -1442,53 +1442,55 @@ public class CameraMetadataNative implements Parcelable {
return samples; return samples;
} }
private Capability[] getBokehCapabilities() { private Capability[] getExtendedSceneModeCapabilities() {
int[] bokehMaxSizes = getBase(CameraCharacteristics.CONTROL_AVAILABLE_BOKEH_MAX_SIZES); int[] maxSizes =
float[] bokehZoomRanges = getBase( getBase(CameraCharacteristics.CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_MAX_SIZES);
CameraCharacteristics.CONTROL_AVAILABLE_BOKEH_ZOOM_RATIO_RANGES); float[] zoomRanges = getBase(
CameraCharacteristics.CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_ZOOM_RATIO_RANGES);
Range<Float> zoomRange = getBase(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE); Range<Float> zoomRange = getBase(CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE);
float maxDigitalZoom = getBase(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM); float maxDigitalZoom = getBase(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM);
if (bokehMaxSizes == null) { if (maxSizes == null) {
return null; return null;
} }
if (bokehMaxSizes.length % 3 != 0) { if (maxSizes.length % 3 != 0) {
throw new AssertionError("availableBokehMaxSizes must be tuples of " + throw new AssertionError("availableExtendedSceneModeMaxSizes must be tuples of "
"[mode, width, height]"); + "[mode, width, height]");
} }
int numBokehModes = bokehMaxSizes.length / 3; int numExtendedSceneModes = maxSizes.length / 3;
int numBokehZoomRanges = 0; int numExtendedSceneModeZoomRanges = 0;
if (bokehZoomRanges != null) { if (zoomRanges != null) {
if (bokehZoomRanges.length % 2 != 0) { if (zoomRanges.length % 2 != 0) {
throw new AssertionError("availableBokehZoomRanges must be tuples of " + throw new AssertionError("availableExtendedSceneModeZoomRanges must be tuples of "
"[minZoom, maxZoom]"); + "[minZoom, maxZoom]");
} }
numBokehZoomRanges = bokehZoomRanges.length / 2; numExtendedSceneModeZoomRanges = zoomRanges.length / 2;
if (numBokehModes - numBokehZoomRanges != 1) { if (numExtendedSceneModes - numExtendedSceneModeZoomRanges != 1) {
throw new AssertionError("Number of bokeh zoom ranges must be 1 less than " + throw new AssertionError("Number of extended scene mode zoom ranges must be 1 "
"number of supported bokeh modes"); + "less than number of supported modes");
} }
} }
float bokehOffMinZoomRatio = 1.0f; float modeOffMinZoomRatio = 1.0f;
float bokehOffMaxZoomRatio = maxDigitalZoom; float modeOffMaxZoomRatio = maxDigitalZoom;
if (zoomRange != null) { if (zoomRange != null) {
bokehOffMinZoomRatio = zoomRange.getLower(); modeOffMinZoomRatio = zoomRange.getLower();
bokehOffMaxZoomRatio = zoomRange.getUpper(); modeOffMaxZoomRatio = zoomRange.getUpper();
} }
Capability[] capabilities = new Capability[numBokehModes]; Capability[] capabilities = new Capability[numExtendedSceneModes];
for (int i = 0, j = 0; i < numBokehModes; i++) { for (int i = 0, j = 0; i < numExtendedSceneModes; i++) {
int mode = bokehMaxSizes[3 * i]; int mode = maxSizes[3 * i];
int width = bokehMaxSizes[3 * i + 1]; int width = maxSizes[3 * i + 1];
int height = bokehMaxSizes[3 * i + 2]; int height = maxSizes[3 * i + 2];
if (mode != CameraMetadata.CONTROL_BOKEH_MODE_OFF && j < numBokehZoomRanges) { if (mode != CameraMetadata.CONTROL_EXTENDED_SCENE_MODE_DISABLED
capabilities[i] = new Capability(mode, width, height, bokehZoomRanges[2 * j], && j < numExtendedSceneModeZoomRanges) {
bokehZoomRanges[2 * j + 1]); capabilities[i] = new Capability(mode, width, height, zoomRanges[2 * j],
zoomRanges[2 * j + 1]);
j++; j++;
} else { } else {
capabilities[i] = new Capability(mode, width, height, bokehOffMinZoomRatio, capabilities[i] = new Capability(mode, width, height, modeOffMinZoomRatio,
bokehOffMaxZoomRatio); modeOffMaxZoomRatio);
} }
} }

View File

@@ -30,7 +30,7 @@ import android.util.Size;
* Immutable class to store the camera capability, its corresponding maximum * Immutable class to store the camera capability, its corresponding maximum
* streaming dimension and zoom range. * streaming dimension and zoom range.
* *
* @see CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES * @see CameraCharacteristics#CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES
*/ */
public final class Capability { public final class Capability {
@@ -72,10 +72,10 @@ public final class Capability {
/** /**
* Return the supported mode for this capability. * Return the supported mode for this capability.
* *
* @return One of supported modes for the capability. For example, for available bokeh modes, * @return One of supported modes for the capability. For example, for available extended
* this will be one of {@link CameraMetadata#CONTROL_BOKEH_MODE_OFF}, * scene modes, this will be one of {@link CameraMetadata#CONTROL_EXTENDED_SCENE_MODE_DISABLED},
* {@link CameraMetadata#CONTROL_BOKEH_MODE_STILL_CAPTURE}, and * {@link CameraMetadata#CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE}, and
* {@link CameraMetadata#CONTROL_BOKEH_MODE_CONTINUOUS}. * {@link CameraMetadata#CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS}.
*/ */
public int getMode() { public int getMode() {
return mMode; return mMode;