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

Commit a2f10fb5 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by android-build-merger
Browse files

CameraService: ZslProcessor: Don't call back into BQ from callback

am: 9eef26c3

Change-Id: I2db501eca0c737aa532b32684ce7ee2732f05d83
parents 3c1ba2cd 9eef26c3
Loading
Loading
Loading
Loading
+19 −4
Original line number Diff line number Diff line
@@ -138,7 +138,8 @@ ZslProcessor::ZslProcessor(
        mInputBuffer(nullptr),
        mProducer(nullptr),
        mInputProducer(nullptr),
        mInputProducerSlot(-1) {
        mInputProducerSlot(-1),
        mBuffersToDetach(0) {
    // Initialize buffer queue and frame list based on pipeline max depth.
    size_t pipelineMaxDepth = kDefaultMaxPipelineDepth;
    if (client != 0) {
@@ -430,6 +431,11 @@ status_t ZslProcessor::updateRequestWithDefaultStillRequest(CameraMetadata &requ
void ZslProcessor::notifyInputReleased() {
    Mutex::Autolock l(mInputMutex);

    mBuffersToDetach++;
    mBuffersToDetachSignal.signal();
}

void ZslProcessor::doNotifyInputReleasedLocked() {
    assert(nullptr != mInputBuffer.get());
    assert(nullptr != mInputProducer.get());

@@ -736,9 +742,18 @@ void ZslProcessor::dump(int fd, const Vector<String16>& /*args*/) const {
}

bool ZslProcessor::threadLoop() {
    // TODO: remove dependency on thread. For now, shut thread down right
    // away.
    return false;
    Mutex::Autolock l(mInputMutex);

    if (mBuffersToDetach == 0) {
        status_t res = mBuffersToDetachSignal.waitRelative(mInputMutex, kWaitDuration);
        if (res == TIMED_OUT) return true;
    }
    while (mBuffersToDetach > 0) {
        doNotifyInputReleasedLocked();
        mBuffersToDetach--;
    }

    return true;
}

void ZslProcessor::dumpZslQueue(int fd) const {
+4 −0
Original line number Diff line number Diff line
@@ -142,6 +142,9 @@ class ZslProcessor :
    sp<IGraphicBufferProducer>               mInputProducer;
    int                                      mInputProducerSlot;

    Condition                                mBuffersToDetachSignal;
    int                                      mBuffersToDetach;

    virtual bool threadLoop();

    status_t clearZslQueueLocked();
@@ -156,6 +159,7 @@ class ZslProcessor :
        nsecs_t* actualTimestamp);
    status_t clearInputRingBufferLocked(nsecs_t* latestTimestamp);
    void notifyInputReleased();
    void doNotifyInputReleasedLocked();

    bool isFixedFocusMode(uint8_t afMode) const;