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

Commit 8091ac4c authored by Zhijun He's avatar Zhijun He Committed by Android (Google) Code Review
Browse files

Merge "ImageFormat: add PRIVATE format"

parents 673cec6a 2f174311
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11138,6 +11138,7 @@ package android.graphics {
    field public static final int JPEG = 256; // 0x100
    field public static final int NV16 = 16; // 0x10
    field public static final int NV21 = 17; // 0x11
    field public static final int PRIVATE = 34; // 0x22
    field public static final int RAW10 = 37; // 0x25
    field public static final int RAW_SENSOR = 32; // 0x20
    field public static final int RGB_565 = 4; // 0x4
+1 −0
Original line number Diff line number Diff line
@@ -11422,6 +11422,7 @@ package android.graphics {
    field public static final int JPEG = 256; // 0x100
    field public static final int NV16 = 16; // 0x10
    field public static final int NV21 = 17; // 0x11
    field public static final int PRIVATE = 34; // 0x22
    field public static final int RAW10 = 37; // 0x25
    field public static final int RAW_SENSOR = 32; // 0x20
    field public static final int RGB_565 = 4; // 0x4
+3 −1
Original line number Diff line number Diff line
@@ -192,6 +192,9 @@ PublicFormat android_view_Surface_mapHalFormatDataspaceToPublicFormat(
        case HAL_PIXEL_FORMAT_YCbCr_422_I:
            // Name differs, though the value is the same
            return PublicFormat::YUY2;
        case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
            // Name differs, though the value is the same
            return PublicFormat::PRIVATE;
        case HAL_PIXEL_FORMAT_Y16:
            // Dataspace-dependent
            switch (dataSpace) {
@@ -216,7 +219,6 @@ PublicFormat android_view_Surface_mapHalFormatDataspaceToPublicFormat(
            break;
        case HAL_PIXEL_FORMAT_BGRA_8888:
        case HAL_PIXEL_FORMAT_RAW_OPAQUE:
        case HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED:
            // Not defined in public API
            return PublicFormat::UNKNOWN;

+28 −0
Original line number Diff line number Diff line
@@ -387,6 +387,33 @@ public class ImageFormat {
     */
    public static final int DEPTH_POINT_CLOUD = 0x101;

    /**
     * Android private opaque image format.
     * <p>
     * The choices of the actual format and pixel data layout are entirely up to
     * the device-specific and framework internal implementations, and may vary
     * depending on use cases even for the same device. The buffers of this
     * format can be produced by components like
     * {@link android.media.ImageWriter ImageWriter} , and interpreted correctly
     * by consumers like {@link android.hardware.camera2.CameraDevice
     * CameraDevice} based on the device/framework private information. However,
     * these buffers are not directly accessible to the application.
     * </p>
     * <p>
     * When an {@link android.media.Image Image} of this format is obtained from
     * an {@link android.media.ImageReader ImageReader} or
     * {@link android.media.ImageWriter ImageWriter}, the
     * {@link android.media.Image#getPlanes() getPlanes()} method will return an
     * empty {@link android.media.Image.Plane Plane} array.
     * </p>
     * <p>
     * If a buffer of this format is to be used as an OpenGL ES texture, the
     * framework will assume that sampling the texture will always return an
     * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values).
     * </p>
     */
    public static final int PRIVATE = 0x22;

    /**
     * Use this function to retrieve the number of bits per pixel of an
     * ImageFormat.
@@ -447,6 +474,7 @@ public class ImageFormat {
            case RAW10:
            case DEPTH16:
            case DEPTH_POINT_CLOUD:
            case PRIVATE:
                return true;
        }

+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ enum class PublicFormat {
    NV21              = 0x11,
    YUY2              = 0x14,
    RAW_SENSOR        = 0x20,
    PRIVATE           = 0x22,
    YUV_420_888       = 0x23,
    RAW10             = 0x25,
    JPEG              = 0x100,