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

Commit bc74e235 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[ALPS09070588] Camera splitter bug fix" into main

parents 2edea5b0 878a952b
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -473,6 +473,12 @@ status_t Camera3StreamSplitter::attachBufferToOutputs(ANativeWindowBuffer* anb,
        mMutex.unlock();
        res = gbp->attachBuffer(&slot, gb);
        mMutex.lock();
        //During buffer attach 'mMutex' is not held which makes the removal of
        //"gbp" possible. Check whether this is the case and continue.
        if (gbp.get() == nullptr) {
            res = OK;
            continue;
        }
        if (res != OK) {
            SP_LOGE("%s: Cannot attachBuffer from GraphicBufferProducer %p: %s (%d)",
                    __FUNCTION__, gbp.get(), strerror(-res), res);
+6 −5
Original line number Diff line number Diff line
@@ -459,6 +459,12 @@ status_t DeprecatedCamera3StreamSplitter::attachBufferToOutputs(
        mMutex.unlock();
        res = gbp->attachBuffer(&slot, gb);
        mMutex.lock();
        // During buffer attach 'mMutex' is not held which makes the removal of
        //"gbp" possible. Check whether this is the case and continue.
        if (gbp.get() == nullptr) {
            res = OK;
            continue;
        }
        if (res != OK) {
            SP_LOGE("%s: Cannot attachBuffer from GraphicBufferProducer %p: %s (%d)", __FUNCTION__,
                    gbp.get(), strerror(-res), res);
@@ -470,11 +476,6 @@ status_t DeprecatedCamera3StreamSplitter::attachBufferToOutputs(
                    __FUNCTION__, slot, BufferQueue::NUM_BUFFER_SLOTS);
            return BAD_VALUE;
        }
        // During buffer attach 'mMutex' is not held which makes the removal of
        //"gbp" possible. Check whether this is the case and continue.
        if (mOutputSlots[gbp] == nullptr) {
            continue;
        }
        auto& outputSlots = *mOutputSlots[gbp];
        if (static_cast<size_t>(slot + 1) > outputSlots.size()) {
            outputSlots.resize(slot + 1);