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

Commit ec5e8d25 authored by Shuzhen Wang's avatar Shuzhen Wang
Browse files

Camera: Unhide and update Y8 format spec

- Unhide Y8 format as part of MONOCHROME camera support.
- Specify required stream combination for Y8 format.

Test: Camera CTS test
Bug: 70216652
Change-Id: Iab28b7ee3f2d5ec534a517079f14e0ed648ae556
parent 68585439
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -13854,6 +13854,7 @@ package android.graphics {
    field public static final int RAW_SENSOR = 32; // 0x20
    field public static final int RGB_565 = 4; // 0x4
    field public static final int UNKNOWN = 0; // 0x0
    field public static final int Y8 = 538982489; // 0x20203859
    field public static final int YUV_420_888 = 35; // 0x23
    field public static final int YUV_422_888 = 39; // 0x27
    field public static final int YUV_444_888 = 40; // 0x28
+32 −1
Original line number Diff line number Diff line
@@ -1583,7 +1583,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     *   {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
     * <li>Processed (but not-stalling): any non-RAW format without a stall duration.  Typically
     *   {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
     *   {@link android.graphics.ImageFormat#NV21 NV21}, or {@link android.graphics.ImageFormat#YV12 YV12}.</li>
     *   {@link android.graphics.ImageFormat#NV21 NV21}, {@link android.graphics.ImageFormat#YV12 YV12}, or {@link android.graphics.ImageFormat#Y8 Y8} .</li>
     * </ul>
     * <p><b>Range of valid values:</b><br></p>
     * <p>For processed (and stalling) format streams, &gt;= 1.</p>
@@ -1646,6 +1646,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
     * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
     * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
     * <li>{@link android.graphics.ImageFormat#Y8 Y8}</li>
     * </ul>
     * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
     * processed format -- it will return 0 for a non-stalling stream.</p>
@@ -2122,6 +2123,35 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * or output will never hurt maximum frame rate (i.e.  {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration getOutputStallDuration(ImageFormat.PRIVATE, size)} is always 0),</p>
     * <p>Attempting to configure an input stream with output streams not
     * listed as available in this map is not valid.</p>
     * <p>Additionally, if the camera device is MONOCHROME with Y8 support, it will also support
     * the following map of formats if its dependent capability
     * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
     * <table>
     * <thead>
     * <tr>
     * <th align="left">Input Format</th>
     * <th align="left">Output Format</th>
     * <th align="left">Capability</th>
     * </tr>
     * </thead>
     * <tbody>
     * <tr>
     * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
     * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
     * <td align="left">PRIVATE_REPROCESSING</td>
     * </tr>
     * <tr>
     * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
     * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
     * <td align="left">YUV_REPROCESSING</td>
     * </tr>
     * <tr>
     * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
     * <td align="left">{@link android.graphics.ImageFormat#Y8 }</td>
     * <td align="left">YUV_REPROCESSING</td>
     * </tr>
     * </tbody>
     * </table>
     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
     *
     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
@@ -2297,6 +2327,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri
     * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
     * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
     * <li>{@link android.graphics.ImageFormat#RAW12 }</li>
     * <li>{@link android.graphics.ImageFormat#Y8 }</li>
     * </ul>
     * <p>All other formats may or may not have an allowed stall duration on
     * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
+5 −0
Original line number Diff line number Diff line
@@ -356,6 +356,11 @@ public abstract class CameraDevice implements AutoCloseable {
     * </table><br>
     * </p>
     *
     * <p>MONOCHROME-capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES}
     * includes {@link CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME MONOCHROME})
     * supporting {@link ImageFormat#Y8 Y8} support substituting {@code YUV} streams with {@code Y8}
     * in all guaranteed stream combinations for the device's hardware level and capabilities.</p>
     *
     * <p>FULL-level ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL}
     * {@code == }{@link CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}) devices
     * support at least the following stream combinations in addition to those for
+11 −3
Original line number Diff line number Diff line
@@ -539,6 +539,8 @@ public abstract class CameraMetadata<TKey> {
     * <li>{@link android.graphics.ImageFormat#PRIVATE } will be reprocessable into both
     *   {@link android.graphics.ImageFormat#YUV_420_888 } and
     *   {@link android.graphics.ImageFormat#JPEG } formats.</li>
     * <li>For a MONOCHROME camera supporting Y8 format, {@link android.graphics.ImageFormat#PRIVATE } will be reprocessable into
     *   {@link android.graphics.ImageFormat#Y8 }.</li>
     * <li>The maximum available resolution for PRIVATE streams
     *   (both input/output) will match the maximum available
     *   resolution of JPEG streams.</li>
@@ -612,7 +614,7 @@ public abstract class CameraMetadata<TKey> {
     * then the list of resolutions for YUV_420_888 from {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes } contains at
     * least one resolution &gt;= 8 megapixels, with a minimum frame duration of &lt;= 1/20
     * s.</p>
     * <p>If the device supports the {@link android.graphics.ImageFormat#RAW10 }, {@link android.graphics.ImageFormat#RAW12 }, then those can also be
     * <p>If the device supports the {@link android.graphics.ImageFormat#RAW10 }, {@link android.graphics.ImageFormat#RAW12 }, {@link android.graphics.ImageFormat#Y8 }, then those can also be
     * captured at the same rate as the maximum-size YUV_420_888 resolution is.</p>
     * <p>If the device supports the PRIVATE_REPROCESSING capability, then the same guarantees
     * as for the YUV_420_888 format also apply to the {@link android.graphics.ImageFormat#PRIVATE } format.</p>
@@ -646,6 +648,8 @@ public abstract class CameraMetadata<TKey> {
     *   {@link android.graphics.ImageFormat#YUV_420_888 } and {@link android.graphics.ImageFormat#JPEG } formats.</li>
     * <li>The maximum available resolution for {@link android.graphics.ImageFormat#YUV_420_888 } streams (both input/output) will match the
     *   maximum available resolution of {@link android.graphics.ImageFormat#JPEG } streams.</li>
     * <li>For a MONOCHROME camera with Y8 format support, all the requirements mentioned
     *   above for YUV_420_888 apply for Y8 format as well.</li>
     * <li>Static metadata {@link CameraCharacteristics#REPROCESS_MAX_CAPTURE_STALL android.reprocess.maxCaptureStall}.</li>
     * <li>Only the below controls are effective for reprocessing requests and will be present
     *   in capture results. The reprocess requests are from the original capture results
@@ -692,8 +696,8 @@ public abstract class CameraMetadata<TKey> {
     * <li>The {@link CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE android.depth.depthIsExclusive} entry is listed by this device.</li>
     * <li>As of Android P, the {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} entry is listed by this device.</li>
     * <li>A LIMITED camera with only the DEPTH_OUTPUT capability does not have to support
     *   normal YUV_420_888, JPEG, and PRIV-format outputs. It only has to support the DEPTH16
     *   format.</li>
     *   normal YUV_420_888, Y8, JPEG, and PRIV-format outputs. It only has to support the
     *   DEPTH16 format.</li>
     * </ul>
     * <p>Generally, depth output operates at a slower frame rate than standard color capture,
     * so the DEPTH16 and DEPTH_POINT_CLOUD formats will commonly have a stall duration that
@@ -877,6 +881,10 @@ public abstract class CameraMetadata<TKey> {
    /**
     * <p>The camera device is a monochrome camera that doesn't contain a color filter array,
     * and the pixel values on U and V planes are all 128.</p>
     * <p>A MONOCHROME camera must support the guaranteed stream combinations required for
     * its device level and capabilities. Additionally, if the monochrome camera device
     * supports Y8 format, all mandatory stream combination requirements related to {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888} apply
     * to {@link android.graphics.ImageFormat#Y8 Y8} as well.</p>
     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
     */
    public static final int REQUEST_AVAILABLE_CAPABILITIES_MONOCHROME = 12;
+2 −2
Original line number Diff line number Diff line
@@ -3277,8 +3277,8 @@ public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
     * will not slow down capture rate when applying correction. FAST may be the same as OFF if
     * any correction at all would slow down capture rate.  Every output stream will have a
     * similar amount of enhancement applied.</p>
     * <p>The correction only applies to processed outputs such as YUV, JPEG, or DEPTH16; it is not
     * applied to any RAW output.</p>
     * <p>The correction only applies to processed outputs such as YUV, Y8, JPEG, or DEPTH16; it is
     * not applied to any RAW output.</p>
     * <p>This control will be on by default on devices that support this control. Applications
     * disabling distortion correction need to pay extra attention with the coordinate system of
     * metering regions, crop region, and face rectangles. When distortion correction is OFF,
Loading