diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2014-08-06 00:14:27 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-05 17:41:31 +0000 |
commit | 1c8d1e4079f2b8efd71423158e7f298cf1dc2c31 (patch) | |
tree | 483ef669dca0852eaef9608d9d88b40699835ef6 | |
parent | a57ab8da6fe56fdb91dfc95ebd0282eb879dde53 (diff) | |
parent | ca05ebd4c666322e754ac63236c8b329dbb53b00 (diff) | |
download | frameworks_av-1c8d1e4079f2b8efd71423158e7f298cf1dc2c31.zip frameworks_av-1c8d1e4079f2b8efd71423158e7f298cf1dc2c31.tar.gz frameworks_av-1c8d1e4079f2b8efd71423158e7f298cf1dc2c31.tar.bz2 |
Merge "cameraservice: disallow zsl/recording coexistentce" into lmp-dev
-rw-r--r-- | services/camera/libcameraservice/api1/Camera2Client.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 9721e13..046988e 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -810,7 +810,9 @@ status_t Camera2Client::startPreviewL(Parameters ¶ms, bool restart) { return res; } } - if (params.zslMode && !params.recordingHint) { + + if (params.zslMode && !params.recordingHint && + getRecordingStreamId() == NO_STREAM) { res = updateProcessorStream(mZslProcessor, params); if (res != OK) { ALOGE("%s: Camera %d: Unable to update ZSL stream: %s (%d)", @@ -1033,6 +1035,36 @@ status_t Camera2Client::startRecordingL(Parameters ¶ms, bool restart) { return res; } } + + if (mZslProcessor->getStreamId() != NO_STREAM) { + ALOGV("%s: Camera %d: Clearing out zsl stream before " + "creating recording stream", __FUNCTION__, mCameraId); + res = mStreamingProcessor->stopStream(); + if (res != OK) { + ALOGE("%s: Camera %d: Can't stop streaming to delete callback stream", + __FUNCTION__, mCameraId); + return res; + } + res = mDevice->waitUntilDrained(); + if (res != OK) { + ALOGE("%s: Camera %d: Waiting to stop streaming failed: %s (%d)", + __FUNCTION__, mCameraId, strerror(-res), res); + } + res = mZslProcessor->clearZslQueue(); + if (res != OK) { + ALOGE("%s: Camera %d: Can't clear zsl queue", + __FUNCTION__, mCameraId); + return res; + } + res = mZslProcessor->deleteStream(); + if (res != OK) { + ALOGE("%s: Camera %d: Unable to delete zsl stream before " + "record: %s (%d)", __FUNCTION__, mCameraId, + strerror(-res), res); + return res; + } + } + // Disable callbacks if they're enabled; can't record and use callbacks, // and we can't fail record start without stagefright asserting. params.previewCallbackFlags = 0; |