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

Commit c2063056 authored by Alex Ray's avatar Alex Ray Committed by Android (Google) Code Review
Browse files

Camera2: Fix prematurely clearing stream request

Zsl handling was clearing the stream request before a capture request
was ready to be sent to the HAL, which would cause capture delays and
timeouts in certain conditions.

Bug: 7259520
Change-Id: Idde8bc4fc58b8b426c6985feac87759740e338ea
parent b3e97b34
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -289,13 +289,6 @@ CaptureSequencer::CaptureState CaptureSequencer::manageZslStart(
    client->registerFrameListener(mCaptureId,
            this);

    res = client->getCameraDevice()->clearStreamingRequest();
    if (res != OK) {
        ALOGE("%s: Camera %d: Unable to stop preview for ZSL capture: "
                "%s (%d)",
                __FUNCTION__, client->getCameraId(), strerror(-res), res);
        return DONE;
    }
    // TODO: Actually select the right thing here.
    res = processor->pushToReprocess(mCaptureId);
    if (res != OK) {
+8 −0
Original line number Diff line number Diff line
@@ -297,6 +297,14 @@ status_t ZslProcessor::pushToReprocess(int32_t requestId) {
            return INVALID_OPERATION;
        }

        res = client->getCameraDevice()->clearStreamingRequest();
        if (res != OK) {
            ALOGE("%s: Camera %d: Unable to stop preview for ZSL capture: "
                "%s (%d)",
                __FUNCTION__, client->getCameraId(), strerror(-res), res);
            return INVALID_OPERATION;
        }
        // TODO: have push-and-clear be atomic
        res = client->getCameraDevice()->pushReprocessBuffer(mZslReprocessStreamId,
                handle, this);
        if (res != OK) {