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

Commit 2b2cd75d authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar Committed by Automerger Merge Worker
Browse files

Merge "Fix -Wbitwise-instead-of-logical" am: 891c19cc

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

Change-Id: Ibbb98e2355123bb745d73aa5303421bc7f630268
parents 1e8f6664 891c19cc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@ status_t AudioValidator::validateEffectDescriptor(
        const effect_descriptor_t& desc, std::string_view bugNumber)
{
    status_t status = NO_ERROR;
    if (checkStringOverflow(desc.name)
        | /* always */ checkStringOverflow(desc.implementor)) {
    if (checkStringOverflow(desc.name) || checkStringOverflow(desc.implementor)) {
        status = BAD_VALUE;
    }
    return safetyNetLog(status, bugNumber);
+23 −22
Original line number Diff line number Diff line
@@ -4446,11 +4446,15 @@ void MPEG4Writer::Track::writeColrBox() {
    memset(&aspects, 0, sizeof(aspects));
    // Color metadata may have changed.
    sp<MetaData> meta = mSource->getFormat();
    // TRICKY: using | instead of || because we want to execute all findInt32-s
    if (meta->findInt32(kKeyColorPrimaries, (int32_t*)&aspects.mPrimaries)
            | meta->findInt32(kKeyTransferFunction, (int32_t*)&aspects.mTransfer)
            | meta->findInt32(kKeyColorMatrix, (int32_t*)&aspects.mMatrixCoeffs)
            | meta->findInt32(kKeyColorRange, (int32_t*)&aspects.mRange)) {
    bool findPrimaries = meta->findInt32(kKeyColorPrimaries, (int32_t*)&aspects.mPrimaries);
    bool findTransfer = meta->findInt32(kKeyTransferFunction, (int32_t*)&aspects.mTransfer);
    bool findMatrix = meta->findInt32(kKeyColorMatrix, (int32_t*)&aspects.mMatrixCoeffs);
    bool findRange = meta->findInt32(kKeyColorRange, (int32_t*)&aspects.mRange);
    if (!findPrimaries && !findTransfer && !findMatrix && !findRange) {
        ALOGV("no color information");
        return;
    }

    int32_t primaries, transfer, coeffs;
    bool fullRange;
    ALOGV("primaries=%s transfer=%s matrix=%s range=%s",
@@ -4467,9 +4471,6 @@ void MPEG4Writer::Track::writeColrBox() {
    mOwner->writeInt16(coeffs);
    mOwner->writeInt8(int8_t(fullRange ? 0x80 : 0x0));
    mOwner->endBox(); // colr
    } else {
        ALOGV("no color information");
    }
}

void MPEG4Writer::Track::writeAudioFourCCBox() {
+8 −6
Original line number Diff line number Diff line
@@ -590,9 +590,10 @@ android_dataspace ColorUtils::getDataSpaceForColorAspects(ColorAspects &aspects,
    uint32_t gfxRange = range;
    uint32_t gfxStandard = standard;
    uint32_t gfxTransfer = transfer;
    // TRICKY: use & to ensure all three mappings are completed
    if (!(sGfxRanges.map(range, &gfxRange) & sGfxStandards.map(standard, &gfxStandard)
            & sGfxTransfers.map(transfer, &gfxTransfer))) {
    bool mappedRange = sGfxRanges.map(range, &gfxRange);
    bool mappedStandard = sGfxStandards.map(standard, &gfxStandard);
    bool mappedTransfer = sGfxTransfers.map(transfer, &gfxTransfer);
    if (! (mappedRange && mappedStandard && mappedTransfer)) {
        ALOGW("could not safely map platform color aspects (R:%u(%s) S:%u(%s) T:%u(%s) to "
              "graphics dataspace (R:%u S:%u T:%u)",
              range, asString(range), standard, asString(standard), transfer, asString(transfer),
@@ -626,9 +627,10 @@ void ColorUtils::getColorConfigFromDataSpace(
    CU::ColorRange    cuRange    = CU::kColorRangeUnspecified;
    CU::ColorStandard cuStandard = CU::kColorStandardUnspecified;
    CU::ColorTransfer cuTransfer = CU::kColorTransferUnspecified;
    // TRICKY: use & to ensure all three mappings are completed
    if (!(sGfxRanges.map(gfxRange, &cuRange) & sGfxStandards.map(gfxStandard, &cuStandard)
            & sGfxTransfers.map(gfxTransfer, &cuTransfer))) {
    bool mappedRange = sGfxRanges.map(gfxRange, &cuRange);
    bool mappedStandard = sGfxStandards.map(gfxStandard, &cuStandard);
    bool mappedTransfer = sGfxTransfers.map(gfxTransfer, &cuTransfer);
    if (! (mappedRange && mappedStandard && mappedTransfer)) {
        ALOGW("could not safely map graphics dataspace (R:%u S:%u T:%u) to "
              "platform color aspects (R:%u(%s) S:%u(%s) T:%u(%s)",
              gfxRange, gfxStandard, gfxTransfer,
+1 −1
Original line number Diff line number Diff line
@@ -1689,7 +1689,7 @@ binder::Status CameraDeviceClient::switchToOffline(
        bool isCompositeStream = false;
        for (const auto& gbp : mConfiguredOutputs[streamId].getGraphicBufferProducers()) {
            sp<Surface> s = new Surface(gbp, false /*controlledByApp*/);
            isCompositeStream = camera3::DepthCompositeStream::isDepthCompositeStream(s) |
            isCompositeStream = camera3::DepthCompositeStream::isDepthCompositeStream(s) ||
                camera3::HeicCompositeStream::isHeicCompositeStream(s);
            if (isCompositeStream) {
                auto compositeIdx = mCompositeStreamMap.indexOfKey(IInterface::asBinder(gbp));
+1 −1
Original line number Diff line number Diff line
@@ -545,7 +545,7 @@ status_t Camera3OutputStream::configureConsumerQueueLocked() {
    mHandoutTotalBufferCount = 0;
    mFrameCount = 0;
    mLastTimestamp = 0;
    mUseMonoTimestamp = (isConsumedByHWComposer() | isVideoStream());
    mUseMonoTimestamp = (isConsumedByHWComposer() || isVideoStream());

    res = native_window_set_buffer_count(mConsumer.get(),
            mTotalBufferCount);