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

Commit 2cec0dfa authored by Ruchit Sharma's avatar Ruchit Sharma Committed by Chien-Yu Chen
Browse files

Camera2Client: flush requests in stopPreviewL

Requests queued in the pipeline have little meaning after the app
calls stopPreview(). Flushing will help improve the switch KPI.

bug 17340914

Change-Id: I899d69aa3b0fd41f028760290a81013297712fed
parent 8ddb0223
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -917,6 +917,15 @@ void Camera2Client::stopPreviewL() {
                ALOGE("%s: Camera %d: Can't stop streaming: %s (%d)",
                        __FUNCTION__, mCameraId, strerror(-res), res);
            }

            // Flush all in-process captures and buffer in order to stop
            // preview faster.
            res = mDevice->flush();
            if (res != OK) {
                ALOGE("%s: Camera %d: Unable to flush pending requests: %s (%d)",
                        __FUNCTION__, mCameraId, strerror(-res), res);
            }

            res = mDevice->waitUntilDrained();
            if (res != OK) {
                ALOGE("%s: Camera %d: Waiting to stop streaming failed: %s (%d)",