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

Commit 8a79a986 authored by wenchangliu's avatar wenchangliu Committed by Automerger Merge Worker
Browse files

Do not use max/min luminance if it's 0 am: f3f9288e

Change-Id: I7190f1326762df1d6ad4e713609eae9841a4dcf8
parents 4b5d5b6d f3f9288e
Loading
Loading
Loading
Loading
+23 −20
Original line number Diff line number Diff line
@@ -851,6 +851,10 @@ status_t CCodecBufferChannel::renderOutputBuffer(
    if (hdrStaticInfo || hdr10PlusInfo) {
        HdrMetadata hdr;
        if (hdrStaticInfo) {
            // If mastering max and min luminance fields are 0, do not use them.
            // It indicates the value may not be present in the stream.
            if (hdrStaticInfo->mastering.maxLuminance > 0.0f &&
                hdrStaticInfo->mastering.minLuminance > 0.0f) {
                struct android_smpte2086_metadata smpte2086_meta = {
                    .displayPrimaryRed = {
                        hdrStaticInfo->mastering.red.x, hdrStaticInfo->mastering.red.y
@@ -867,10 +871,9 @@ status_t CCodecBufferChannel::renderOutputBuffer(
                    .maxLuminance = hdrStaticInfo->mastering.maxLuminance,
                    .minLuminance = hdrStaticInfo->mastering.minLuminance,
                };

                hdr.validTypes = HdrMetadata::SMPTE2086;
                hdr.smpte2086 = smpte2086_meta;

            }
            // If the content light level fields are 0, do not use them, it
            // indicates the value may not be present in the stream.
            if (hdrStaticInfo->maxCll > 0.0f && hdrStaticInfo->maxFall > 0.0f) {