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

Commit 0702d1f6 authored by Chong Zhang's avatar Chong Zhang
Browse files

Actually use the hdr mapper for AV1 in GetHdrProfileLevelMapper

It's defined but not returned by GetHdrProfileLevelMapper, so
soft AV1 doesn't report HDR support.

bug: 138314480
test:

atest android.media.cts.DecoderTest#testAV1HdrStaticMetadata
atest android.media.cts.MediaMetadataRetrieverTest#testThumbnailAV1Hdr

Test should pass, AND test shouldn't be skipped.
For MediaMetadataRetrieverTest#testThumbnailAV1Hdr, enable output
file dump and there should be output file dumped.

Change-Id: I8c571729bb68d091208d5348734efd29887b5f72
parent c6c78b6c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -117,8 +117,9 @@ void addSupportedProfileLevels(
        }
    }

    // For VP9, the static info is always propagated by framework.
    // For VP9/AV1, the static info is always propagated by framework.
    supportsHdr |= (mediaType == MIMETYPE_VIDEO_VP9);
    supportsHdr |= (mediaType == MIMETYPE_VIDEO_AV1);

    for (C2Value::Primitive profile : profileQuery[0].values.values) {
        pl.profile = (C2Config::profile_t)profile.ref<uint32_t>();
+4 −1
Original line number Diff line number Diff line
@@ -382,10 +382,11 @@ ALookup<C2Config::profile_t, int32_t> sAv1Profiles = {
    // TODO: will need to disambiguate between Main8 and Main10
    { C2Config::PROFILE_AV1_0, AV1ProfileMain8 },
    { C2Config::PROFILE_AV1_0, AV1ProfileMain10 },
    { C2Config::PROFILE_AV1_0, AV1ProfileMain10HDR10 },
    { C2Config::PROFILE_AV1_0, AV1ProfileMain10HDR10Plus },
};

ALookup<C2Config::profile_t, int32_t> sAv1HdrProfiles = {
    { C2Config::PROFILE_AV1_0, AV1ProfileMain10 },
    { C2Config::PROFILE_AV1_0, AV1ProfileMain10HDR10 },
};

@@ -662,6 +663,8 @@ C2Mapper::GetHdrProfileLevelMapper(std::string mediaType, bool isHdr10Plus) {
        return std::make_shared<HevcProfileLevelMapper>(true, isHdr10Plus);
    } else if (mediaType == MIMETYPE_VIDEO_VP9) {
        return std::make_shared<Vp9ProfileLevelMapper>(true, isHdr10Plus);
    } else if (mediaType == MIMETYPE_VIDEO_AV1) {
        return std::make_shared<Av1ProfileLevelMapper>(true, isHdr10Plus);
    }
    return nullptr;
}