diff options
author | Zhijun He <zhijunhe@google.com> | 2014-06-23 22:04:11 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-23 17:44:28 +0000 |
commit | d5d08c57fab3b8ccbdb5df206b579e51308dd3e7 (patch) | |
tree | 475ed475ab0f1b951a36889147b67afac58548be | |
parent | c27f5259cf2c45ea6f0a021fc17578f32f6c2f7d (diff) | |
parent | e2d83756cb088db15fda73616ca097b8d190e1a1 (diff) | |
download | frameworks_av-d5d08c57fab3b8ccbdb5df206b579e51308dd3e7.zip frameworks_av-d5d08c57fab3b8ccbdb5df206b579e51308dd3e7.tar.gz frameworks_av-d5d08c57fab3b8ccbdb5df206b579e51308dd3e7.tar.bz2 |
Merge "Camera: Clear ZSL buffer queue when jpeg size is changed"
-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); |