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

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

Make retrieving SMPTE2094-10 metadata optional.

Devices that do not support this metadata are not required to support
getting or setting it on gralloc buffers, as SMPTE2094-10 is only used
for some HDR standards that are not guaranteed to be supported.

Bug: 205245993
Test: builds
Change-Id: Ic3501230015ddce49ce977963356c0578af7c50f
parent c40bae7d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -22,8 +22,9 @@ package android.hardware.graphics.common;
 * This is an enum that defines the common types of gralloc 4 buffer metadata. The comments for
 * each enum include a description of the metadata that is associated with the type.
 *
 * IMapper@4.x must support getting the following standard buffer metadata types. IMapper@4.x may
 * support setting these standard buffer metadata types as well.
 * IMapper@4.x must support getting the following standard buffer metadata types, with the exception
 * of SMPTE 2094-10 metadata. IMapper@4.x may support setting these standard buffer metadata types
 * as well.
 *
 * When encoding these StandardMetadataTypes into a byte stream, the associated MetadataType is
 * is first encoded followed by the StandardMetadataType value. The MetadataType is encoded by
+7 −1
Original line number Diff line number Diff line
@@ -92,7 +92,13 @@ class GraphicsMapperHidlTest
        ASSERT_NO_FATAL_FAILURE(bufferHandle = mGralloc->allocate(descriptorInfo, true));

        hidl_vec<uint8_t> vec;
        ASSERT_EQ(Error::NONE, mGralloc->get(bufferHandle, metadataType, &vec));
        const auto result = mGralloc->get(bufferHandle, metadataType, &vec);

        if (metadataType == gralloc4::MetadataType_Smpte2094_10 && result == Error::UNSUPPORTED) {
            GTEST_SKIP() << "getting metadata for Smpte2094-10 is unsupported";
        }

        ASSERT_EQ(Error::NONE, result);

        ASSERT_NO_FATAL_FAILURE(decode(descriptorInfo, vec));
    }