Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91bdd4f0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Add bokeh mode tags in camera metadata"

parents 2acaae92 1ab85145
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -16859,6 +16859,7 @@ 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<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<android.hardware.camera2.params.CapabilityAndMaxSize[]> 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_MODES;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> CONTROL_AVAILABLE_SCENE_MODES;
@@ -17074,6 +17075,9 @@ package android.hardware.camera2 {
    field public static final int CONTROL_AWB_STATE_INACTIVE = 0; // 0x0
    field public static final int CONTROL_AWB_STATE_LOCKED = 3; // 0x3
    field public static final int CONTROL_AWB_STATE_SEARCHING = 1; // 0x1
    field public static final int CONTROL_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_MANUAL = 6; // 0x6
    field public static final int CONTROL_CAPTURE_INTENT_MOTION_TRACKING = 7; // 0x7
@@ -17269,6 +17273,7 @@ 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.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<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_EFFECT_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL;
@@ -17354,6 +17359,7 @@ 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<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_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_EFFECT_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Boolean> CONTROL_ENABLE_ZSL;
@@ -17450,6 +17456,11 @@ package android.hardware.camera2.params {
    field public static final int COUNT = 4; // 0x4
  }
  public final class CapabilityAndMaxSize {
    method @NonNull public android.util.Size getMaxStreamingSize();
    method public int getMode();
  }
  public final class ColorSpaceTransform {
    ctor public ColorSpaceTransform(android.util.Rational[]);
    ctor public ColorSpaceTransform(int[]);
+31 −0
Original line number Diff line number Diff line
@@ -1124,6 +1124,37 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
    public static final Key<android.util.Range<Integer>> CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE =
            new Key<android.util.Range<Integer>>("android.control.postRawSensitivityBoostRange", new TypeReference<android.util.Range<Integer>>() {{ }});

    /**
     * <p>The list of bokeh modes that are supported by this camera device, and each bokeh mode's
     * maximum streaming (non-stall) size with bokeh effect.</p>
     * <p>For OFF mode, the camera behaves normally with no bokeh effect.</p>
     * <p>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.</p>
     * <p>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.</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>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
     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
     *
     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
     */
    @PublicKey
    @NonNull
    public static final Key<android.hardware.camera2.params.CapabilityAndMaxSize[]> CONTROL_AVAILABLE_BOKEH_CAPABILITIES =
            new Key<android.hardware.camera2.params.CapabilityAndMaxSize[]>("android.control.availableBokehCapabilities", android.hardware.camera2.params.CapabilityAndMaxSize[].class);

    /**
     * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
     * device.</p>
+28 −0
Original line number Diff line number Diff line
@@ -2443,6 +2443,34 @@ public abstract class CameraMetadata<TKey> {
     */
    public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1;

    //
    // Enumeration values for CaptureRequest#CONTROL_BOKEH_MODE
    //

    /**
     * <p>Bokeh mode is disabled.</p>
     * @see CaptureRequest#CONTROL_BOKEH_MODE
     */
    public static final int CONTROL_BOKEH_MODE_OFF = 0;

    /**
     * <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
     * 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>
     * @see CaptureRequest#CONTROL_BOKEH_MODE
     */
    public static final int CONTROL_BOKEH_MODE_STILL_CAPTURE = 1;

    /**
     * <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
     * streaming dimension. This mode should be used if performance and power are a
     * priority, such as video recording.</p>
     * @see CaptureRequest#CONTROL_BOKEH_MODE
     */
    public static final int CONTROL_BOKEH_MODE_CONTINUOUS = 2;

    //
    // Enumeration values for CaptureRequest#EDGE_MODE
    //
+47 −1
Original line number Diff line number Diff line
@@ -994,7 +994,7 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
     * application controls how the color mapping is performed.</p>
     * <p>We define the expected processing pipeline below. For consistency
     * across devices, this is always the case with TRANSFORM_MATRIX.</p>
     * <p>When either FULL or HIGH_QUALITY is used, the camera device may
     * <p>When either FAST or HIGH_QUALITY is used, the camera device may
     * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
     * camera device (in the results) and be roughly correct.</p>
@@ -2093,6 +2093,52 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
    public static final Key<Boolean> CONTROL_ENABLE_ZSL =
            new Key<Boolean>("android.control.enableZsl", boolean.class);

    /**
     * <p>Whether bokeh 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
     * 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
     * processing needed for high quality bokeh effect, the stall may be longer than when
     * capture intent is not STILL_CAPTURE.</p>
     * <p>When set to STILL_CAPTURE bokeh mode with PREVIEW capture intent,</p>
     * <ul>
     * <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of
     * BURST_CAPTURE must still be met.</li>
     * <li>All streams not larger than the maximum streaming dimension for STILL_CAPTURE mode
     * (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES })
     * will have preview bokeh effect applied.</li>
     * </ul>
     * <p>When set to 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.</p>
     * <p>Switching between different bokeh 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 }.</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
     * with different field of view. As a result, when bokeh mode is enabled, the camera device
     * may override android.scaler.CropRegion, and the field of view will be smaller than when
     * bokeh mode is off.</p>
     * <p><b>Possible values:</b>
     * <ul>
     *   <li>{@link #CONTROL_BOKEH_MODE_OFF OFF}</li>
     *   <li>{@link #CONTROL_BOKEH_MODE_STILL_CAPTURE STILL_CAPTURE}</li>
     *   <li>{@link #CONTROL_BOKEH_MODE_CONTINUOUS CONTINUOUS}</li>
     * </ul></p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     * @see #CONTROL_BOKEH_MODE_OFF
     * @see #CONTROL_BOKEH_MODE_STILL_CAPTURE
     * @see #CONTROL_BOKEH_MODE_CONTINUOUS
     */
    @PublicKey
    @NonNull
    public static final Key<Integer> CONTROL_BOKEH_MODE =
            new Key<Integer>("android.control.bokehMode", int.class);

    /**
     * <p>Operation mode for edge
     * enhancement.</p>
+47 −1
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
     * application controls how the color mapping is performed.</p>
     * <p>We define the expected processing pipeline below. For consistency
     * across devices, this is always the case with TRANSFORM_MATRIX.</p>
     * <p>When either FULL or HIGH_QUALITY is used, the camera device may
     * <p>When either FAST or HIGH_QUALITY is used, the camera device may
     * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
     * camera device (in the results) and be roughly correct.</p>
@@ -2323,6 +2323,52 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
    public static final Key<Integer> CONTROL_AF_SCENE_CHANGE =
            new Key<Integer>("android.control.afSceneChange", int.class);

    /**
     * <p>Whether bokeh 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
     * 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
     * processing needed for high quality bokeh effect, the stall may be longer than when
     * capture intent is not STILL_CAPTURE.</p>
     * <p>When set to STILL_CAPTURE bokeh mode with PREVIEW capture intent,</p>
     * <ul>
     * <li>If the camera device has BURST_CAPTURE capability, the frame rate requirement of
     * BURST_CAPTURE must still be met.</li>
     * <li>All streams not larger than the maximum streaming dimension for STILL_CAPTURE mode
     * (queried via {@link android.hardware.camera2.CameraCharacteristics#CONTROL_AVAILABLE_BOKEH_CAPABILITIES })
     * will have preview bokeh effect applied.</li>
     * </ul>
     * <p>When set to 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.</p>
     * <p>Switching between different bokeh 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 }.</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
     * with different field of view. As a result, when bokeh mode is enabled, the camera device
     * may override android.scaler.CropRegion, and the field of view will be smaller than when
     * bokeh mode is off.</p>
     * <p><b>Possible values:</b>
     * <ul>
     *   <li>{@link #CONTROL_BOKEH_MODE_OFF OFF}</li>
     *   <li>{@link #CONTROL_BOKEH_MODE_STILL_CAPTURE STILL_CAPTURE}</li>
     *   <li>{@link #CONTROL_BOKEH_MODE_CONTINUOUS CONTINUOUS}</li>
     * </ul></p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     * @see #CONTROL_BOKEH_MODE_OFF
     * @see #CONTROL_BOKEH_MODE_STILL_CAPTURE
     * @see #CONTROL_BOKEH_MODE_CONTINUOUS
     */
    @PublicKey
    @NonNull
    public static final Key<Integer> CONTROL_BOKEH_MODE =
            new Key<Integer>("android.control.bokehMode", int.class);

    /**
     * <p>Operation mode for edge
     * enhancement.</p>
Loading