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

Commit f63f1d90 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Relax maximum Hal buffers and acquired count check

For some resolutions input HeifWriter surfaces have much higher
acquired buffer count compared to the maximum Hal buffer for the
respective use case. From the tests so far shared streaming doesn't
seem to be affected by the imbalance and the splitter is able to
support this case.

Bug: 110161669
Test: Camera CTS
Change-Id: I129221b0f35e45c8b26f27f94910a6edda8d675b
parent b8fd364d
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -253,6 +253,10 @@ status_t Camera3StreamSplitter::addOutputLocked(size_t surfaceId, const sp<Surfa
    // Add new entry into mOutputs
    mOutputs[surfaceId] = gbp;
    mConsumerBufferCount[surfaceId] = maxConsumerBuffers;
    if (mConsumerBufferCount[surfaceId] > mMaxHalBuffers) {
        SP_LOGW("%s: Consumer buffer count %zu larger than max. Hal buffers: %zu", __FUNCTION__,
                mConsumerBufferCount[surfaceId], mMaxHalBuffers);
    }
    mNotifiers[gbp] = listener;
    mOutputSlots[gbp] = std::make_unique<OutputSlots>(totalBufferCount);

@@ -324,11 +328,7 @@ status_t Camera3StreamSplitter::removeOutputLocked(size_t surfaceId) {
    }

    mNotifiers[gbp] = nullptr;
    if (mConsumerBufferCount[surfaceId] < mMaxHalBuffers) {
    mMaxConsumerBuffers -= mConsumerBufferCount[surfaceId];
    } else {
        SP_LOGE("%s: Cached consumer buffer count mismatch!", __FUNCTION__);
    }
    mConsumerBufferCount[surfaceId] = 0;

    return res;