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

Commit a6e71bbd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera3Device: Wait for empty in-flight map when waiting for idle"

parents e65f331e 24b366ec
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -169,6 +169,9 @@ status_t Camera3Device::initialize(CameraModule *module)
        return res;
    }

    /** Register in-flight map to the status tracker */
    mInFlightStatusId = mStatusTracker->addComponent();

    /** Create buffer manager */
    mBufferManager = new Camera3BufferManager();

@@ -2198,6 +2201,10 @@ status_t Camera3Device::registerInFlight(uint32_t frameNumber,
            aeTriggerCancelOverride));
    if (res < 0) return res;

    if (mInFlightMap.size() == 1) {
        mStatusTracker->markComponentActive(mInFlightStatusId);
    }

    return OK;
}

@@ -2254,6 +2261,11 @@ void Camera3Device::removeInFlightRequestIfReadyLocked(int idx) {

        mInFlightMap.removeItemsAt(idx, 1);

        // Indicate idle inFlightMap to the status tracker
        if (mInFlightMap.size() == 0) {
            mStatusTracker->markComponentIdle(mInFlightStatusId, Fence::NO_FENCE);
        }

        ALOGVV("%s: removed frame %d from InFlightMap", __FUNCTION__, frameNumber);
     }

+1 −0
Original line number Diff line number Diff line
@@ -727,6 +727,7 @@ class Camera3Device :

    Mutex                  mInFlightLock; // Protects mInFlightMap
    InFlightMap            mInFlightMap;
    int                    mInFlightStatusId;

    status_t registerInFlight(uint32_t frameNumber,
            int32_t numBuffers, CaptureResultExtras resultExtras, bool hasInput,