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

Commit 70040729 authored by Alec Mouri's avatar Alec Mouri
Browse files

Add HDR-related revisions to graphics types

* Add standard metadata support for data described by the SMPTE 2094-10
standard. This corresponds to Dolby Vision support, and as such the
metadata will use an opaque format, similar to existing support for the
SMPTE 2094-40 standard.
* Relax P010 definition so that arbitrary semiplanar layouts are
supported. For devices implementing Gralloc 4, sufficient information is
exposed from PlaneLayout that clients are able to interpret the buffer
content correctly without the additional layout restrictions.
Furthermore, this brings the gralloc definition in-line with the relaxed
definition in android.media.ImageFormat.

Bug: 196617266
Bug: 200309502
Test: builds
Change-Id: I23774c81488292324de06dd4e3a8341421432a57
parent 9441d3f0
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -56,4 +56,5 @@ enum StandardMetadataType {
  SMPTE2086 = 19,
  CTA861_3 = 20,
  SMPTE2094_40 = 21,
  SMPTE2094_10 = 22,
}
+32 −43
Original line number Diff line number Diff line
@@ -470,19 +470,8 @@ enum PixelFormat {

    /**
     * P010 is a 4:2:0 YCbCr semiplanar format comprised of a WxH Y plane
     * followed immediately by a Wx(H/2) CbCr plane. Each sample is
     * represented by a 16-bit little-endian value, with the lower 6 bits set
     * to zero.
     *
     * This format assumes
     * - an even height
     * - a vertical stride equal to the height
     *
     *   stride_in_bytes = stride * 2
     *   y_size = stride_in_bytes * height
     *   cbcr_size = stride_in_bytes * (height / 2)
     *   cb_offset = y_size
     *   cr_offset = cb_offset + 2
     * followed by a Wx(H/2) CbCr plane. Each sample is represented by a 16-bit
     * little-endian value, with the lower 6 bits set to zero.
     *
     * This format must be accepted by the allocator when used with the
     * following usage flags:
+14 −1
Original line number Diff line number Diff line
@@ -344,7 +344,7 @@ enum StandardMetadataType {
    /**
     * Can be used to get or set dynamic HDR metadata specified by SMPTE ST 2094-40:2016.
     *
     * This metadata is uint8_t byte array.
     * This metadata is a uint8_t byte array.
     *
     * This is not used in tone mapping until it has been set for the first time.
     *
@@ -353,4 +353,17 @@ enum StandardMetadataType {
     * If this is unset when encoded into a byte stream, the byte stream is empty.
     */
    SMPTE2094_40 = 21,

    /**
     * Can be used to get or set dynamic HDR metadata specified by SMPTE ST 2094-10:2016.
     *
     * This metadata is a uint8_t byte array.
     *
     * This is not used in tone mapping until it has been set for the first time.
     *
     * When it is encoded into a byte stream, the length of the HDR metadata byte array is written
     * using 8 bytes in little endian. It is followed by the uint8_t byte array.
     * If this is unset when encoded into a byte stream, the byte stream is empty.
     */
    SMPTE2094_10 = 22,
}