diff options
author | Ruchit Sharma <ruchits@nvidia.com> | 2014-08-20 16:02:08 -0400 |
---|---|---|
committer | Chien-Yu Chen <cychen@google.com> | 2014-12-15 11:54:41 -0800 |
commit | 2cec0dfa9f97b87733b8b250b49729fc6bb3a60a (patch) | |
tree | 32dc6deae539198198775b871dec33a5b7d65902 /services/camera | |
parent | 8ddb02230d02968d471aa41b22433957c38827c0 (diff) | |
download | frameworks_av-2cec0dfa9f97b87733b8b250b49729fc6bb3a60a.zip frameworks_av-2cec0dfa9f97b87733b8b250b49729fc6bb3a60a.tar.gz frameworks_av-2cec0dfa9f97b87733b8b250b49729fc6bb3a60a.tar.bz2 |
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
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/api1/Camera2Client.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 6e7824e..dcab4ad 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -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)", |