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

Commit a58358e9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add HEIC_ULTRAHDR image format" into main

parents a142834b ba41b511
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16419,6 +16419,7 @@ package android.graphics {
    field public static final int FLEX_RGBA_8888 = 42; // 0x2a
    field public static final int FLEX_RGB_888 = 41; // 0x29
    field public static final int HEIC = 1212500294; // 0x48454946
    field @FlaggedApi("com.android.internal.camera.flags.camera_heif_gainmap") public static final int HEIC_ULTRAHDR = 4102; // 0x1006
    field public static final int JPEG = 256; // 0x100
    field public static final int JPEG_R = 4101; // 0x1005
    field public static final int NV16 = 16; // 0x10
@@ -18709,6 +18710,7 @@ package android.hardware {
    field public static final int DATASPACE_DISPLAY_P3 = 143261696; // 0x88a0000
    field public static final int DATASPACE_DYNAMIC_DEPTH = 4098; // 0x1002
    field public static final int DATASPACE_HEIF = 4100; // 0x1004
    field @FlaggedApi("com.android.internal.camera.flags.camera_heif_gainmap") public static final int DATASPACE_HEIF_ULTRAHDR = 4102; // 0x1006
    field public static final int DATASPACE_JFIF = 146931712; // 0x8c20000
    field public static final int DATASPACE_JPEG_R = 4101; // 0x1005
    field public static final int DATASPACE_SCRGB = 411107328; // 0x18810000
+28 −7
Original line number Diff line number Diff line
@@ -420,18 +420,38 @@ public final class DataSpace {
    public static final int DATASPACE_HEIF = 4100;

    /**
     * ISO/IEC TBD
     * Ultra HDR
     *
     * JPEG image with embedded recovery map following the Jpeg/R specification.
     * JPEG image with embedded HDR gain map following the Ultra HDR specification and
     * starting with Android version {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM V}
     * ISO/CD 21496‐1
     *
     * <p>This value must always remain aligned with the public ImageFormat Jpeg/R definition and is
     * valid with formats:
     *    HAL_PIXEL_FORMAT_BLOB: JPEG image encoded by Jpeg/R encoder according to ISO/IEC TBD.
     * The image contains a standard SDR JPEG and a recovery map. Jpeg/R decoders can use the
     * map to recover the input image.</p>
     * <p>This value is valid with formats:</p>
     * <ul>
     *    <li>HAL_PIXEL_FORMAT_BLOB: JPEG image encoded by Jpeg/R encoder according to
     *    ISO/CD 21496‐1</li>
     * </ul>
     * <p>
     * The image contains a standard SDR JPEG and a gain map. Ultra HDR decoders can use the
     * gain map to boost the brightness of the rendered image.</p>
     */
     public static final int DATASPACE_JPEG_R = 4101;

    /**
     * ISO/IEC 23008-12:2024
     *
     * High Efficiency Image File Format (HEIF) with embedded HDR gain map
     *
     * <p>This value is valid with formats:</p>
     * <ul>
     *    <li>HAL_PIXEL_FORMAT_BLOB: A HEIC image encoded by HEVC encoder
     *    according to ISO/IEC 23008-12:2024 that includes an HDR gain map and
     *    metadata according to ISO/CD 21496‐1.</li>
     * </ul>
     */
    @FlaggedApi(com.android.internal.camera.flags.Flags.FLAG_CAMERA_HEIF_GAINMAP)
    public static final int DATASPACE_HEIF_ULTRAHDR = 4102;

    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(flag = true, value = {
@@ -660,6 +680,7 @@ public final class DataSpace {
        DATASPACE_DEPTH,
        DATASPACE_DYNAMIC_DEPTH,
        DATASPACE_HEIF,
        DATASPACE_HEIF_ULTRAHDR,
        DATASPACE_JPEG_R,
        DATASPACE_UNKNOWN,
        DATASPACE_SCRGB_LINEAR,
+116 −0
Original line number Diff line number Diff line
@@ -5774,6 +5774,122 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION =
            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);

    /**
     * <p>The available HEIC (ISO/IEC 23008-12/24) UltraHDR stream
     * configurations that this camera device supports
     * (i.e. format, width, height, output/input stream).</p>
     * <p>The configurations are listed as <code>(format, width, height, input?)</code> tuples.</p>
     * <p>All the static, control, and dynamic metadata tags related to JPEG apply to HEIC formats.
     * Configuring JPEG and HEIC streams at the same time is not supported.</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
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
    public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STREAM_CONFIGURATIONS =
            new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicUltraHdrStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);

    /**
     * <p>This lists the minimum frame duration for each
     * format/size combination for HEIC UltraHDR output formats.</p>
     * <p>This should correspond to the frame duration when only that
     * stream is active, with all processing (typically in android.*.mode)
     * set to either OFF or FAST.</p>
     * <p>When multiple streams are used in a request, the minimum frame
     * duration will be max(individual stream min durations).</p>
     * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
     * android.scaler.availableStallDurations for more details about
     * calculating the max frame rate.</p>
     * <p><b>Units</b>: (format, width, height, ns) x n</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
     * @see CaptureRequest#SENSOR_FRAME_DURATION
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_MIN_FRAME_DURATIONS =
            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);

    /**
     * <p>This lists the maximum stall duration for each
     * output format/size combination for HEIC UltraHDR streams.</p>
     * <p>A stall duration is how much extra time would get added
     * to the normal minimum frame duration for a repeating request
     * that has streams with non-zero stall.</p>
     * <p>This functions similarly to
     * android.scaler.availableStallDurations for HEIC UltraHDR
     * streams.</p>
     * <p>All HEIC output stream formats may have a nonzero stall
     * duration.</p>
     * <p><b>Units</b>: (format, width, height, ns) x n</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
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STALL_DURATIONS =
            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);

    /**
     * <p>The available HEIC (ISO/IEC 23008-12/24) UltraHDR stream
     * configurations that this camera device supports
     * (i.e. format, width, height, output/input stream) for CaptureRequests where
     * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
     * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
     * <p>Refer to android.heic.availableHeicStreamConfigurations for details.</p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     *
     * @see CaptureRequest#SENSOR_PIXEL_MODE
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
    public static final Key<android.hardware.camera2.params.StreamConfiguration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION =
            new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.heic.availableHeicUltraHdrStreamConfigurationsMaximumResolution", android.hardware.camera2.params.StreamConfiguration[].class);

    /**
     * <p>This lists the minimum frame duration for each
     * format/size combination for HEIC UltraHDR output formats for CaptureRequests where
     * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
     * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
     * <p>Refer to android.heic.availableHeicMinFrameDurations for details.</p>
     * <p><b>Units</b>: (format, width, height, ns) x n</p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     *
     * @see CaptureRequest#SENSOR_PIXEL_MODE
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION =
            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrMinFrameDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);

    /**
     * <p>This lists the maximum stall duration for each
     * output format/size combination for HEIC UltraHDR streams for CaptureRequests where
     * {@link CaptureRequest#SENSOR_PIXEL_MODE android.sensor.pixelMode} is set to
     * {@link android.hardware.camera2.CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION }.</p>
     * <p>Refer to android.heic.availableHeicStallDurations for details.</p>
     * <p><b>Units</b>: (format, width, height, ns) x n</p>
     * <p><b>Optional</b> - The value for this key may be {@code null} on some devices.</p>
     *
     * @see CaptureRequest#SENSOR_PIXEL_MODE
     * @hide
     */
    @FlaggedApi(Flags.FLAG_CAMERA_HEIF_GAINMAP)
    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> HEIC_AVAILABLE_HEIC_ULTRA_HDR_STALL_DURATIONS_MAXIMUM_RESOLUTION =
            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.heic.availableHeicUltraHdrStallDurationsMaximumResolution", android.hardware.camera2.params.StreamConfigurationDuration[].class);

    /**
     * <p>The direction of the camera faces relative to the vehicle body frame and the
     * passenger seats.</p>
+38 −2
Original line number Diff line number Diff line
@@ -1385,6 +1385,9 @@ public class CameraMetadataNative implements Parcelable {
                            /*jpegRconfiguration*/ null,
                            /*jpegRminduration*/ null,
                            /*jpegRstallduration*/ null,
                            /*heicUltraHDRconfiguration*/ null,
                            /*heicUltraHDRminduration*/ null,
                            /*heicUltraHDRstallduration*/ null,
                            /*highspeedvideoconfigurations*/ null,
                            /*inputoutputformatsmap*/ null, listHighResolution, supportsPrivate[i]);
                    break;
@@ -1402,6 +1405,9 @@ public class CameraMetadataNative implements Parcelable {
                            /*jpegRconfiguration*/ null,
                            /*jpegRminduration*/ null,
                            /*jpegRstallduration*/ null,
                            /*heicUltraHDRconfiguration*/ null,
                            /*heicUltraHDRminduration*/ null,
                            /*heicUltraHDRstallduration*/ null,
                            highSpeedVideoConfigurations,
                            /*inputoutputformatsmap*/ null, listHighResolution, supportsPrivate[i]);
                    break;
@@ -1419,6 +1425,9 @@ public class CameraMetadataNative implements Parcelable {
                            /*jpegRconfiguration*/ null,
                            /*jpegRminduration*/ null,
                            /*jpegRstallduration*/ null,
                            /*heicUltraHDRcconfiguration*/ null,
                            /*heicUltraHDRminduration*/ null,
                            /*heicUltraHDRstallduration*/ null,
                            /*highSpeedVideoConfigurations*/ null,
                            inputOutputFormatsMap, listHighResolution, supportsPrivate[i]);
                    break;
@@ -1436,6 +1445,9 @@ public class CameraMetadataNative implements Parcelable {
                            /*jpegRconfiguration*/ null,
                            /*jpegRminduration*/ null,
                            /*jpegRstallduration*/ null,
                            /*heicUltraHDRcconfiguration*/ null,
                            /*heicUltraHDRminduration*/ null,
                            /*heicUltraHDRstallduration*/ null,
                            /*highSpeedVideoConfigurations*/ null,
                            /*inputOutputFormatsMap*/ null, listHighResolution, supportsPrivate[i]);
            }
@@ -1607,6 +1619,17 @@ public class CameraMetadataNative implements Parcelable {
                CameraCharacteristics.HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS);
        StreamConfigurationDuration[] heicStallDurations = getBase(
                CameraCharacteristics.HEIC_AVAILABLE_HEIC_STALL_DURATIONS);
        StreamConfiguration[] heicUltraHDRConfigurations = null;
        StreamConfigurationDuration[] heicUltraHDRMinFrameDurations = null;
        StreamConfigurationDuration[] heicUltraHDRStallDurations = null;
        if (Flags.cameraHeifGainmap()) {
            heicUltraHDRConfigurations = getBase(
                    CameraCharacteristics.HEIC_AVAILABLE_HEIC_ULTRA_HDR_STREAM_CONFIGURATIONS);
            heicUltraHDRMinFrameDurations = getBase(
                    CameraCharacteristics.HEIC_AVAILABLE_HEIC_ULTRA_HDR_MIN_FRAME_DURATIONS);
            heicUltraHDRStallDurations = getBase(
                    CameraCharacteristics.HEIC_AVAILABLE_HEIC_ULTRA_HDR_STALL_DURATIONS);
        }
        StreamConfiguration[] jpegRConfigurations = getBase(
                CameraCharacteristics.JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS);
        StreamConfigurationDuration[] jpegRMinFrameDurations = getBase(
@@ -1625,7 +1648,8 @@ public class CameraMetadataNative implements Parcelable {
                dynamicDepthStallDurations, heicConfigurations,
                heicMinFrameDurations, heicStallDurations,
                jpegRConfigurations, jpegRMinFrameDurations, jpegRStallDurations,
                highSpeedVideoConfigurations, inputOutputFormatsMap,
                heicUltraHDRConfigurations, heicUltraHDRMinFrameDurations,
                heicUltraHDRStallDurations, highSpeedVideoConfigurations, inputOutputFormatsMap,
                listHighResolution);
    }

@@ -1662,6 +1686,17 @@ public class CameraMetadataNative implements Parcelable {
                CameraCharacteristics.HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION);
        StreamConfigurationDuration[] heicStallDurations = getBase(
                CameraCharacteristics.HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION);
        StreamConfiguration[] heicUltraHDRConfigurations = null;
        StreamConfigurationDuration[] heicUltraHDRMinFrameDurations = null;
        StreamConfigurationDuration[] heicUltraHDRStallDurations = null;
        if (Flags.cameraHeifGainmap()) {
            heicUltraHDRConfigurations = getBase(
                    CameraCharacteristics.HEIC_AVAILABLE_HEIC_ULTRA_HDR_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION);
            heicUltraHDRMinFrameDurations = getBase(
                    CameraCharacteristics.HEIC_AVAILABLE_HEIC_ULTRA_HDR_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION);
            heicUltraHDRStallDurations = getBase(
                    CameraCharacteristics.HEIC_AVAILABLE_HEIC_ULTRA_HDR_STALL_DURATIONS_MAXIMUM_RESOLUTION);
        }
        StreamConfiguration[] jpegRConfigurations = getBase(
                CameraCharacteristics.JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION);
        StreamConfigurationDuration[] jpegRMinFrameDurations = getBase(
@@ -1681,7 +1716,8 @@ public class CameraMetadataNative implements Parcelable {
                dynamicDepthStallDurations, heicConfigurations,
                heicMinFrameDurations, heicStallDurations,
                jpegRConfigurations, jpegRMinFrameDurations, jpegRStallDurations,
                highSpeedVideoConfigurations, inputOutputFormatsMap,
                heicUltraHDRConfigurations, heicUltraHDRMinFrameDurations,
                heicUltraHDRStallDurations, highSpeedVideoConfigurations, inputOutputFormatsMap,
                listHighResolution, false);
    }

+136 −7

File changed.

Preview size limit exceeded, changes collapsed.

Loading