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

Commit 69c3bc22 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Add support for extension specific metadata

Enable extension client support for receiving extension type
results and controlling the extension strength.

Bug: 257136838
Test: Camera CTS
Change-Id: I7512128fedd80bdce0bde8e33a523356102e025a
parent b769860c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -17753,6 +17753,7 @@ package android.hardware.camera2 {
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_MAX_ANALOG_SENSITIVITY;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<android.graphics.Rect[]> SENSOR_OPTICAL_BLACK_REGIONS;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_ORIENTATION;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_READOUT_TIMESTAMP;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Integer> SENSOR_REFERENCE_ILLUMINANT1;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<java.lang.Byte> SENSOR_REFERENCE_ILLUMINANT2;
    field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key<int[]> SHADING_AVAILABLE_MODES;
@@ -18121,6 +18122,8 @@ package android.hardware.camera2 {
    field public static final int SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN = 0; // 0x0
    field public static final int SENSOR_PIXEL_MODE_DEFAULT = 0; // 0x0
    field public static final int SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION = 1; // 0x1
    field public static final int SENSOR_READOUT_TIMESTAMP_HARDWARE = 1; // 0x1
    field public static final int SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED = 0; // 0x0
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10; // 0xa
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14; // 0xe
    field public static final int SENSOR_REFERENCE_ILLUMINANT1_D50 = 23; // 0x17
@@ -18234,6 +18237,7 @@ package android.hardware.camera2 {
    field @NonNull public static final android.os.Parcelable.Creator<android.hardware.camera2.CaptureRequest> CREATOR;
    field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> DISTORTION_CORRECTION_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> EDGE_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> EXTENSION_STRENGTH;
    field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> FLASH_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<java.lang.Integer> HOT_PIXEL_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureRequest.Key<android.location.Location> JPEG_GPS_LOCATION;
@@ -18326,6 +18330,8 @@ package android.hardware.camera2 {
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Float> CONTROL_ZOOM_RATIO;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> DISTORTION_CORRECTION_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EDGE_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EXTENSION_CURRENT_TYPE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> EXTENSION_STRENGTH;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> FLASH_MODE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> FLASH_STATE;
    field @NonNull public static final android.hardware.camera2.CaptureResult.Key<java.lang.Integer> HOT_PIXEL_MODE;
+2 −1
Original line number Diff line number Diff line
@@ -4613,7 +4613,6 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * <p>This key is available on all devices.</p>
     * @see #SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED
     * @see #SENSOR_READOUT_TIMESTAMP_HARDWARE
     * @hide
     */
    @PublicKey
    @NonNull
@@ -5572,4 +5571,6 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri





}
+0 −2
Original line number Diff line number Diff line
@@ -1695,7 +1695,6 @@ public abstract class CameraMetadata<TKey> {
     * <p>This camera device doesn't support readout timestamp and onReadoutStarted
     * callback.</p>
     * @see CameraCharacteristics#SENSOR_READOUT_TIMESTAMP
     * @hide
     */
    public static final int SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED = 0;

@@ -1705,7 +1704,6 @@ public abstract class CameraMetadata<TKey> {
     * readout timestamp is generated by the camera hardware and it has the same accuracy
     * and timing characteristics of the start-of-exposure time.</p>
     * @see CameraCharacteristics#SENSOR_READOUT_TIMESTAMP
     * @hide
     */
    public static final int SENSOR_READOUT_TIMESTAMP_HARDWARE = 1;

+34 −0
Original line number Diff line number Diff line
@@ -4154,6 +4154,38 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
    public static final Key<Integer> DISTORTION_CORRECTION_MODE =
            new Key<Integer>("android.distortionCorrection.mode", int.class);

    /**
     * <p>Strength of the extension post-processing effect</p>
     * <p>This control allows Camera extension clients to configure the strength of the applied
     * extension effect. Strength equal to 0 means that the extension must not apply any
     * post-processing and return a regular captured frame. Strength equal to 100 is the
     * default level of post-processing applied when the control is not supported or not set
     * by the client. Values between 0 and 100 will have different effect depending on the
     * extension type as described below:</p>
     * <ul>
     * <li>{@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_BOKEH BOKEH} -
     * the strength is expected to control the amount of blur.</li>
     * <li>{@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_HDR HDR} and
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_NIGHT NIGHT} -
     * the strength can control the amount of images fused and the brightness of the final image.</li>
     * <li>{@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH FACE_RETOUCH} -
     * the strength value will control the amount of cosmetic enhancement and skin
     * smoothing.</li>
     * </ul>
     * <p>The control will be supported if the capture request key is part of the list generated by
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#getAvailableCaptureRequestKeys }.
     * The control is only defined and available to clients sending capture requests via
     * {@link android.hardware.camera2.CameraExtensionSession }.
     * The default value is 100.</p>
     * <p><b>Range of valid values:</b><br>
     * 0 - 100</p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     */
    @PublicKey
    @NonNull
    public static final Key<Integer> EXTENSION_STRENGTH =
            new Key<Integer>("android.extension.strength", int.class);

    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
     * End generated code
     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
@@ -4163,4 +4195,6 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>





}
+58 −0
Original line number Diff line number Diff line
@@ -5576,6 +5576,62 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
    public static final Key<Integer> DISTORTION_CORRECTION_MODE =
            new Key<Integer>("android.distortionCorrection.mode", int.class);

    /**
     * <p>Contains the extension type of the currently active extension</p>
     * <p>The capture result will only be supported and included by camera extension
     * {@link android.hardware.camera2.CameraExtensionSession sessions}.
     * In case the extension session was configured to use
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_AUTOMATIC AUTO},
     * then the extension type value will indicate the currently active extension like
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_HDR HDR},
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_NIGHT NIGHT} etc.
     * , and will never return
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_AUTOMATIC AUTO}.
     * In case the extension session was configured to use an extension different from
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_AUTOMATIC AUTO},
     * then the result type will always match with the configured extension type.</p>
     * <p><b>Range of valid values:</b><br>
     * Extension type value listed in
     * {@link android.hardware.camera2.CameraExtensionCharacteristics }</p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     */
    @PublicKey
    @NonNull
    public static final Key<Integer> EXTENSION_CURRENT_TYPE =
            new Key<Integer>("android.extension.currentType", int.class);

    /**
     * <p>Strength of the extension post-processing effect</p>
     * <p>This control allows Camera extension clients to configure the strength of the applied
     * extension effect. Strength equal to 0 means that the extension must not apply any
     * post-processing and return a regular captured frame. Strength equal to 100 is the
     * default level of post-processing applied when the control is not supported or not set
     * by the client. Values between 0 and 100 will have different effect depending on the
     * extension type as described below:</p>
     * <ul>
     * <li>{@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_BOKEH BOKEH} -
     * the strength is expected to control the amount of blur.</li>
     * <li>{@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_HDR HDR} and
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_NIGHT NIGHT} -
     * the strength can control the amount of images fused and the brightness of the final image.</li>
     * <li>{@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH FACE_RETOUCH} -
     * the strength value will control the amount of cosmetic enhancement and skin
     * smoothing.</li>
     * </ul>
     * <p>The control will be supported if the capture request key is part of the list generated by
     * {@link android.hardware.camera2.CameraExtensionCharacteristics#getAvailableCaptureRequestKeys }.
     * The control is only defined and available to clients sending capture requests via
     * {@link android.hardware.camera2.CameraExtensionSession }.
     * The default value is 100.</p>
     * <p><b>Range of valid values:</b><br>
     * 0 - 100</p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     */
    @PublicKey
    @NonNull
    public static final Key<Integer> EXTENSION_STRENGTH =
            new Key<Integer>("android.extension.strength", int.class);

    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
     * End generated code
     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
@@ -5585,4 +5641,6 @@ public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {





}