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

Commit 841bc9aa authored by Bertil Åkesson's avatar Bertil Åkesson Committed by Chong Zhang
Browse files

Add support for HLG HDR video thumbnails

Android added support for correctly applying color transfer for
thumbnails of HDR videos with PQ color transfer, this expands it to HLG
color transfer.

Bug: 151096599
Test: manual - see bug
Change-Id: I880b2baeeab49a623fcc6e3568c1569b9d3788e4
parent 6b4d9a1f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -67,7 +67,8 @@ ui::Dataspace translateDataspace(ui::Dataspace dataspace) {
bool isHdrY410(const BufferItem &bi) {
    ui::Dataspace dataspace = translateDataspace(static_cast<ui::Dataspace>(bi.mDataSpace));
    // pixel format is HDR Y410 masquerading as RGBA_1010102
    return (dataspace == ui::Dataspace::BT2020_ITU_PQ &&
    return ((dataspace == ui::Dataspace::BT2020_ITU_PQ ||
            dataspace == ui::Dataspace::BT2020_ITU_HLG) &&
            bi.mGraphicBuffer->getPixelFormat() == HAL_PIXEL_FORMAT_RGBA_1010102);
}

+2 −1
Original line number Diff line number Diff line
@@ -248,7 +248,8 @@ bool isHDR(const sp<AMessage> &format) {
        transfer = 0;
    }
    return standard == ColorUtils::kColorStandardBT2020 &&
            transfer == ColorUtils::kColorTransferST2084;
            (transfer == ColorUtils::kColorTransferST2084 ||
            transfer == ColorUtils::kColorTransferHLG);
}

status_t FrameDecoder::init(