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

Commit 907ca35f authored by Wonsik Kim's avatar Wonsik Kim Committed by Automerger Merge Worker
Browse files

Merge "CCodec: query color transfer request only when configured" am: 26fc1a84

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/1932678

Change-Id: I162c350ff60918dbcf7fa6b55e0931506d32213c
parents a6fd6676 26fc1a84
Loading
Loading
Loading
Loading
+19 −10
Original line number Diff line number Diff line
@@ -1213,11 +1213,25 @@ void CCodec::configure(const sp<AMessage> &msg) {
        std::initializer_list<C2Param::Index> indices {
            colorAspectsRequestIndex.withStream(0u),
        };
        c2_status_t c2err = comp->query(
        int32_t colorTransferRequest = 0;
        if (config->mDomain & (Config::IS_IMAGE | Config::IS_VIDEO)
                && !sdkParams->findInt32("color-transfer-request", &colorTransferRequest)) {
            colorTransferRequest = 0;
        }
        c2_status_t c2err = C2_OK;
        if (colorTransferRequest != 0) {
            c2err = comp->query(
                    { &usage, &maxInputSize, &prepend },
                    indices,
                    C2_DONT_BLOCK,
                    &params);
        } else {
            c2err = comp->query(
                    { &usage, &maxInputSize, &prepend },
                    {},
                    C2_DONT_BLOCK,
                    &params);
        }
        if (c2err != C2_OK && c2err != C2_BAD_INDEX) {
            ALOGE("Failed to query component interface: %d", c2err);
            return UNKNOWN_ERROR;
@@ -1360,11 +1374,6 @@ void CCodec::configure(const sp<AMessage> &msg) {
                colorTransferRequestParam = std::move(param);
            }
        }
        int32_t colorTransferRequest = 0;
        if (config->mDomain & (Config::IS_IMAGE | Config::IS_VIDEO)
                && !sdkParams->findInt32("color-transfer-request", &colorTransferRequest)) {
            colorTransferRequest = 0;
        }

        if (colorTransferRequest != 0) {
            if (colorTransferRequestParam && *colorTransferRequestParam) {