diff options
| author | Eino-Ville Talvala <etalvala@google.com> | 2012-10-08 12:17:36 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-08 12:17:37 -0700 |
| commit | b8f0090af19b95027d2e08667c662d058832f94b (patch) | |
| tree | 4f6f5200db131ad2e6a2fadf30d403881e05875c /services/camera/libcameraservice/Camera2Client.cpp | |
| parent | e18c1cce29dde2054ce52b9135b152901883ca91 (diff) | |
| parent | d5087f91357a9218580596b466926ab750bc8ea7 (diff) | |
| download | frameworks_av-b8f0090af19b95027d2e08667c662d058832f94b.zip frameworks_av-b8f0090af19b95027d2e08667c662d058832f94b.tar.gz frameworks_av-b8f0090af19b95027d2e08667c662d058832f94b.tar.bz2 | |
Merge "Camera2: On stopping preview, wait until captures are completed." into jb-mr1-dev
Diffstat (limited to 'services/camera/libcameraservice/Camera2Client.cpp')
| -rw-r--r-- | services/camera/libcameraservice/Camera2Client.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp index 3239483..e073e39 100644 --- a/services/camera/libcameraservice/Camera2Client.cpp +++ b/services/camera/libcameraservice/Camera2Client.cpp @@ -378,16 +378,7 @@ void Camera2Client::disconnect() { ALOGV("Camera %d: Shutting down", mCameraId); - res = mStreamingProcessor->stopStream(); - if (res != OK) { - ALOGE("%s: Problem stopping streaming: %s (%d)", - __FUNCTION__, strerror(-res), res); - } - res = mDevice->waitUntilDrained(); - if (res != OK) { - ALOGE("%s: Problem waiting for HAL: %s (%d)", - __FUNCTION__, strerror(-res), res); - } + stopPreviewL(); { SharedParameters::Lock l(mParameters); @@ -733,6 +724,7 @@ void Camera2Client::stopPreview() { void Camera2Client::stopPreviewL() { ATRACE_CALL(); status_t res; + const nsecs_t kStopCaptureTimeout = 3000000000LL; // 3 seconds Parameters::State state; { SharedParameters::Lock l(mParameters); @@ -745,13 +737,11 @@ void Camera2Client::stopPreviewL() { __FUNCTION__, mCameraId); break; case Parameters::STOPPED: - break; + case Parameters::VIDEO_SNAPSHOT: case Parameters::STILL_CAPTURE: - ALOGE("%s: Camera %d: Cannot stop preview during still capture.", - __FUNCTION__, mCameraId); - break; + mCaptureSequencer->waitUntilIdle(kStopCaptureTimeout); + // no break case Parameters::RECORD: - // no break - identical to preview case Parameters::PREVIEW: mStreamingProcessor->stopStream(); res = mDevice->waitUntilDrained(); |
