From 796863a5ec507d472825e77cdec0d8bc0cb6f3b4 Mon Sep 17 00:00:00 2001
From: Shuzhen Wang The list of bokeh modes for {@link CaptureRequest#CONTROL_BOKEH_MODE android.control.bokehMode} that are supported by this camera
- * device, and each bokeh mode's maximum streaming (non-stall) size with bokeh effect. For OFF mode, the camera behaves normally with no bokeh effect. For STILL_CAPTURE mode, the maximum streaming dimension specifies the limit under which
- * bokeh is effective when capture intent is PREVIEW. Note that when capture intent is
- * PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE intent
- * in order to maintain reasonable frame rate. The maximum streaming dimension must be one
- * of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or (0, 0)
- * if preview bokeh is not supported. If the application configures a stream larger than
- * the maximum streaming dimension, bokeh effect may not be applied for this stream for
- * PREVIEW intent. For CONTINUOUS mode, the maximum streaming dimension specifies the limit under which
- * bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE resolutions
- * in availableStreamConfigurations, and if the sensor maximum resolution is larger than or
- * equal to 1080p, the maximum streaming dimension must be at least 1080p. If the
- * application configures a stream with larger dimension, the stream may not have bokeh
- * effect applied. The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that are supported
+ * by this camera device, and each extended scene mode's maximum streaming (non-stall) size
+ * with effect. For DISABLED mode, the camera behaves normally with no extended scene mode enabled. For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
+ * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
+ * intent is PREVIEW, the bokeh effect may not be as high in quality compared to
+ * STILL_CAPTURE intent in order to maintain reasonable frame rate. The maximum streaming
+ * dimension must be one of the YUV_420_888 or PRIVATE resolutions in
+ * availableStreamConfigurations, or (0, 0) if preview bokeh is not supported. If the
+ * application configures a stream larger than the maximum streaming dimension, bokeh
+ * effect may not be applied for this stream for PREVIEW intent. For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
+ * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
+ * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
+ * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
+ * If the application configures a stream with larger dimension, the stream may not have
+ * bokeh effect applied. Units: (mode, width, height) Optional - The value for this key may be {@code null} on some devices. Limited capability -
* 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 The ranges of supported zoom ratio for non-OFF {@link CaptureRequest#CONTROL_BOKEH_MODE android.control.bokehMode}. When bokeh mode is enabled, 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
- * supported non-OFF bokeh modes, in the same order as in
- * {@link CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES android.control.availableBokehCapabilities}. The ranges of supported zoom ratio for non-DISABLED {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode}. When extended scene mode is set, the camera device may have limited range of zoom ratios
+ * compared to when extended scene mode is DISABLED. This tag lists the zoom ratio ranges
+ * for all supported non-DISABLED extended scene modes, in the same order as in
+ * android.control.availableExtended. Range [1.0, 1.0] means that no zoom (optical or digital) is supported. Units: (minZoom, maxZoom) Optional - The value for this key may be {@code null} on some devices. The list of bokeh modes for {@link CaptureRequest#CONTROL_BOKEH_MODE android.control.bokehMode} that are supported by
- * this camera device, and each bokeh mode's capabilities such as maximum streaming size
- * with bokeh effect, and supported zoom ratio ranges. For OFF mode, the camera behaves normally with no bokeh effect. For STILL_CAPTURE mode, the maximum streaming dimension specifies the limit under which
- * bokeh is effective when capture intent is PREVIEW. Note that when capture intent is
- * PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE intent
- * in order to maintain reasonable frame rate. The maximum streaming dimension must be one
- * of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or (0, 0)
- * if preview bokeh is not supported. If the application configures a stream larger than
- * the maximum streaming dimension, bokeh effect may not be applied for this stream for
- * PREVIEW intent. For CONTINUOUS mode, the maximum streaming dimension specifies the limit under which
- * bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE resolutions
- * in availableStreamConfigurations, and if the sensor maximum resolution is larger than or
- * equal to 1080p, the maximum streaming dimension must be at least 1080p. If the
- * application configures a stream with larger dimension, the stream may not have bokeh
- * effect applied. When bokeh mode is enabled, the camera device may have limited range of zoom ratios
- * compared to when bokeh mode is disabled. availableBokehCapabilities lists the zoom
- * ranges for all supported bokeh modes. A range of (1.0, 1.0) means that no zoom
+ * The list of extended scene modes for {@link CaptureRequest#CONTROL_EXTENDED_SCENE_MODE android.control.extendedSceneMode} that
+ * are supported by this camera device, and each extended scene mode's capabilities such
+ * as maximum streaming size, and supported zoom ratio ranges. For DISABLED mode, the camera behaves normally with no extended scene mdoe enabled. For BOKEH_STILL_CAPTURE mode, the maximum streaming dimension specifies the limit
+ * under which bokeh is effective when capture intent is PREVIEW. Note that when capture
+ * intent is PREVIEW, the bokeh effect may not be as high quality compared to STILL_CAPTURE
+ * intent in order to maintain reasonable frame rate. The maximum streaming dimension must
+ * be one of the YUV_420_888 or PRIVATE resolutions in availableStreamConfigurations, or
+ * (0, 0) if preview bokeh is not supported. If the application configures a stream
+ * larger than the maximum streaming dimension, bokeh effect may not be applied for this
+ * stream for PREVIEW intent. For BOKEH_CONTINUOUS mode, the maximum streaming dimension specifies the limit under
+ * which bokeh is effective. This dimension must be one of the YUV_420_888 or PRIVATE
+ * resolutions in availableStreamConfigurations, and if the sensor maximum resolution is
+ * larger than or equal to 1080p, the maximum streaming dimension must be at least 1080p.
+ * If the application configures a stream with larger dimension, the stream may not have
+ * bokeh effect applied. When extended scene mode is set, the camera device may have limited range of zoom ratios
+ * compared to when the mode is DISABLED. availableExtendedSceneModeCapabilities lists the
+ * zoom ranges for all supported extended modes. A range of (1.0, 1.0) means that no zoom
* (optical or digital) is supported. Optional - The value for this key may be {@code null} on some devices. Minimum and maximum zoom ratios supported by this camera device.
For extended scene modes such as BOKEH, please use USE_EXTENDED_SCENE_MODE instead.
* * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES * @see CaptureRequest#CONTROL_MODE @@ -2209,6 +2210,19 @@ public abstract class CameraMetadataUse a specific extended scene mode.
+ *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.
+ *This setting can only be used if extended scene mode is supported (i.e. + * android.control.availableExtendedSceneModes + * contains some modes other than DISABLED).
+ * @see CaptureRequest#CONTROL_MODE + */ + public static final int CONTROL_MODE_USE_EXTENDED_SCENE_MODE = 4; + // // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE // @@ -2540,32 +2554,39 @@ public abstract class CameraMetadataBokeh mode is disabled.
- * @see CaptureRequest#CONTROL_BOKEH_MODE + *Extended scene mode is disabled.
+ * @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; /** *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 * 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.
- * @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; /** *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 * streaming dimension. This mode should be used if performance and power are a * priority, such as video recording.
- * @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; + + /** + *Vendor defined extended scene modes. These depend on vendor implementation.
+ * @see CaptureRequest#CONTROL_EXTENDED_SCENE_MODE + * @hide + */ + public static final int CONTROL_EXTENDED_SCENE_MODE_VENDOR_START = 0x40; // // Enumeration values for CaptureRequest#EDGE_MODE diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java index c1554af5b2197..0ee748287fa29 100644 --- a/core/java/android/hardware/camera2/CaptureRequest.java +++ b/core/java/android/hardware/camera2/CaptureRequest.java @@ -1911,10 +1911,10 @@ public final class CaptureRequest extends CameraMetadataWhen set to AUTO, the individual algorithm controls in * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.
- *When set to USE_SCENE_MODE, the individual controls in + *
When set to USE_SCENE_MODE or USE_EXTENDED_SCENE_MODE, the individual controls in * android.control.* are mostly disabled, and the camera device - * implements one of the scene mode settings (such as ACTION, - * SUNSET, or PARTY) as it wishes. The camera device scene mode + * implements one of the scene mode or extended scene mode settings (such as ACTION, + * SUNSET, PARTY, or BOKEH) as it wishes. The camera device scene mode * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.
*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
@@ -1927,6 +1927,7 @@ public final class CaptureRequest extends CameraMetadata
Available values for this device:
* {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}
Whether bokeh mode is enabled for a particular capture request.
+ *Whether extended scene mode is enabled for a particular capture request.
*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.
- *When set to STILL_CAPTURE bokeh mode with STILL_CAPTURE capture intent, due to the extra + *
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 * capture intent is not STILL_CAPTURE.
- *When set to STILL_CAPTURE bokeh mode with PREVIEW capture intent,
+ *When set to BOKEH_STILL_CAPTURE mode with PREVIEW capture intent,
*When set to CONTINUOUS mode, configured streams dimension should not exceed this mode's + *
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 * be available for streams larger than the maximum streaming dimension.
- *Switching between different bokeh modes may involve reconfiguration of the camera + *
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 * available session keys queried via * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.
- *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.
*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 - * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, and the field of view will be smaller than when - * bokeh mode is off.
+ * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, and the field of + * view may be smaller than when bokeh mode is off. *Possible values: *
Optional - The value for this key may be {@code null} on some devices.
* + * @see CaptureRequest#CONTROL_ZOOM_RATIO * @see CaptureRequest#SCALER_CROP_REGION - * @see #CONTROL_BOKEH_MODE_OFF - * @see #CONTROL_BOKEH_MODE_STILL_CAPTURE - * @see #CONTROL_BOKEH_MODE_CONTINUOUS + * @see #CONTROL_EXTENDED_SCENE_MODE_DISABLED + * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE + * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS */ @PublicKey @NonNull - public static final KeyThe desired zoom ratio
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java index b4c1d72faed4c..096aa0cd27b3b 100644 --- a/core/java/android/hardware/camera2/CaptureResult.java +++ b/core/java/android/hardware/camera2/CaptureResult.java @@ -2118,10 +2118,10 @@ public class CaptureResult extends CameraMetadataWhen set to AUTO, the individual algorithm controls in * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.
- *When set to USE_SCENE_MODE, the individual controls in + *
When set to USE_SCENE_MODE or USE_EXTENDED_SCENE_MODE, the individual controls in * android.control.* are mostly disabled, and the camera device - * implements one of the scene mode settings (such as ACTION, - * SUNSET, or PARTY) as it wishes. The camera device scene mode + * implements one of the scene mode or extended scene mode settings (such as ACTION, + * SUNSET, PARTY, or BOKEH) as it wishes. The camera device scene mode * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.
*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
@@ -2134,6 +2134,7 @@ public class CaptureResult extends CameraMetadata
Available values for this device:
* {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}
Whether bokeh mode is enabled for a particular capture request.
+ *Whether extended scene mode is enabled for a particular capture request.
*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.
- *When set to STILL_CAPTURE bokeh mode with STILL_CAPTURE capture intent, due to the extra + *
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 * capture intent is not STILL_CAPTURE.
- *When set to STILL_CAPTURE bokeh mode with PREVIEW capture intent,
+ *When set to BOKEH_STILL_CAPTURE mode with PREVIEW capture intent,
*When set to CONTINUOUS mode, configured streams dimension should not exceed this mode's + *
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 * be available for streams larger than the maximum streaming dimension.
- *Switching between different bokeh modes may involve reconfiguration of the camera + *
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 * available session keys queried via * {@link android.hardware.camera2.CameraCharacteristics#getAvailableSessionKeys }.
- *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.
*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 - * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, and the field of view will be smaller than when - * bokeh mode is off.
+ * may override {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} or {@link CaptureRequest#CONTROL_ZOOM_RATIO android.control.zoomRatio}, and the field of + * view may be smaller than when bokeh mode is off. *Possible values: *
Optional - The value for this key may be {@code null} on some devices.
* + * @see CaptureRequest#CONTROL_ZOOM_RATIO * @see CaptureRequest#SCALER_CROP_REGION - * @see #CONTROL_BOKEH_MODE_OFF - * @see #CONTROL_BOKEH_MODE_STILL_CAPTURE - * @see #CONTROL_BOKEH_MODE_CONTINUOUS + * @see #CONTROL_EXTENDED_SCENE_MODE_DISABLED + * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_STILL_CAPTURE + * @see #CONTROL_EXTENDED_SCENE_MODE_BOKEH_CONTINUOUS */ @PublicKey @NonNull - public static final KeyThe desired zoom ratio
diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java index df77f52bb0345..786db6e20d140 100644 --- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java +++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java @@ -714,12 +714,12 @@ public class CameraMetadataNative implements Parcelable { } }); sGetCommandMap.put( - CameraCharacteristics.CONTROL_AVAILABLE_BOKEH_CAPABILITIES.getNativeKey(), + CameraCharacteristics.CONTROL_AVAILABLE_EXTENDED_SCENE_MODE_CAPABILITIES.getNativeKey(), new GetCommand() { @Override @SuppressWarnings("unchecked") public