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

Commit 759ac74b authored by Wonsik Kim's avatar Wonsik Kim
Browse files

CCodec: fix default color aspects handling

Bug: 181049458
Test: atest android.mediav2.cts.DecoderColorAspectsTest
Change-Id: I203537112460236bdc1cb6942c0e99a22a489467
parent efd0374e
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -417,16 +417,17 @@ void CCodecConfig::initializeStandardParams() {

    // read back default for decoders. This is needed in case the component does not support
    // color aspects. In that case, these values get copied to color-* keys.
    // TRICKY: We read these values at raw port, since that's where we want to read these.
    add(ConfigMapper("default-color-range",     C2_PARAMKEY_DEFAULT_COLOR_ASPECTS,   "range")
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::CODED & D::READ)
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::RAW & D::READ)
        .withC2Mappers<C2Color::range_t>());
    add(ConfigMapper("default-color-transfer",  C2_PARAMKEY_DEFAULT_COLOR_ASPECTS,   "transfer")
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::CODED & D::READ)
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::RAW & D::READ)
        .withC2Mappers<C2Color::transfer_t>());
    add(ConfigMapper("default-color-primaries", C2_PARAMKEY_DEFAULT_COLOR_ASPECTS,   "primaries")
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::CODED & D::READ));
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::RAW & D::READ));
    add(ConfigMapper("default-color-matrix",    C2_PARAMKEY_DEFAULT_COLOR_ASPECTS,   "matrix")
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::CODED & D::READ));
        .limitTo((D::VIDEO | D::IMAGE) & D::DECODER  & D::RAW & D::READ));

    // read back final for decoder output (also, configure final aspects as well. This should be
    // overwritten based on coded/default values if component supports color aspects, but is used