diff options
author | Zhijun He <zhijunhe@google.com> | 2014-06-23 10:22:37 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2014-06-23 11:06:39 -0700 |
commit | e2d83756cb088db15fda73616ca097b8d190e1a1 (patch) | |
tree | aba00df07423c9e47fb428c3d98ba0985a6d67bc | |
parent | cd8fce8fbe0f515e53a0ea0f50b739cf42ee57a4 (diff) | |
download | frameworks_av-e2d83756cb088db15fda73616ca097b8d190e1a1.zip frameworks_av-e2d83756cb088db15fda73616ca097b8d190e1a1.tar.gz frameworks_av-e2d83756cb088db15fda73616ca097b8d190e1a1.tar.bz2 |
Camera: Clear ZSL buffer queue when jpeg size is changed
Bug: 15284653
Change-Id: I4778e8443945d918801102ba600874568bde12dc
-rw-r--r-- | services/camera/libcameraservice/api1/Camera2Client.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index a6f5a6c..0b6ad92 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -753,6 +753,7 @@ status_t Camera2Client::startPreviewL(Parameters ¶ms, bool restart) { // ever take a picture. // TODO: Find a better compromise, though this likely would involve HAL // changes. + int lastJpegStreamId = mJpegProcessor->getStreamId(); res = updateProcessorStream(mJpegProcessor, params); if (res != OK) { ALOGE("%s: Camera %d: Can't pre-configure still image " @@ -760,6 +761,7 @@ status_t Camera2Client::startPreviewL(Parameters ¶ms, bool restart) { __FUNCTION__, mCameraId, strerror(-res), res); return res; } + bool jpegStreamChanged = mJpegProcessor->getStreamId() != lastJpegStreamId; Vector<int32_t> outputStreams; bool callbacksEnabled = (params.previewCallbackFlags & @@ -815,6 +817,12 @@ status_t Camera2Client::startPreviewL(Parameters ¶ms, bool restart) { __FUNCTION__, mCameraId, strerror(-res), res); return res; } + + if (jpegStreamChanged) { + ALOGV("%s: Camera %d: Clear ZSL buffer queue when Jpeg size is changed", + __FUNCTION__, mCameraId); + mZslProcessor->clearZslQueue(); + } outputStreams.push(getZslStreamId()); } else { mZslProcessor->deleteStream(); @@ -1268,6 +1276,7 @@ status_t Camera2Client::takePicture(int msgType) { ALOGV("%s: Camera %d: Starting picture capture", __FUNCTION__, mCameraId); + int lastJpegStreamId = mJpegProcessor->getStreamId(); res = updateProcessorStream(mJpegProcessor, l.mParameters); if (res != OK) { ALOGE("%s: Camera %d: Can't set up still image stream: %s (%d)", @@ -1275,6 +1284,14 @@ status_t Camera2Client::takePicture(int msgType) { return res; } takePictureCounter = ++l.mParameters.takePictureCounter; + + // Clear ZSL buffer queue when Jpeg size is changed. + bool jpegStreamChanged = mJpegProcessor->getStreamId() != lastJpegStreamId; + if (l.mParameters.zslMode && jpegStreamChanged) { + ALOGV("%s: Camera %d: Clear ZSL buffer queue when Jpeg size is changed", + __FUNCTION__, mCameraId); + mZslProcessor->clearZslQueue(); + } } ATRACE_ASYNC_BEGIN(kTakepictureLabel, takePictureCounter); |