summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-10-04 17:01:25 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-05 16:14:48 -0700
commitf6e09d200c3e043737adcdadd52310ebbd1b19da (patch)
treeffce307ae9ce6dbc4e9b36e0353f48f563818520 /services/camera
parent7373cbe85e617345f7002256a4be389fe62af913 (diff)
downloadframeworks_av-f6e09d200c3e043737adcdadd52310ebbd1b19da.zip
frameworks_av-f6e09d200c3e043737adcdadd52310ebbd1b19da.tar.gz
frameworks_av-f6e09d200c3e043737adcdadd52310ebbd1b19da.tar.bz2
Camera2: Unconditionally shut down streams on disconnect.
stopPreviewL may do nothing in certain states. Stop streams directly to avoid those failures, so that we always maintain the HAL interface invariant that streams referenced by in-flight requests are never deleted. Bug: 7276954 Change-Id: Ic4cffc43036f4944684d941981a43d6dd1dce7af
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/Camera2Client.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index 90cba46..3239483 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -378,7 +378,16 @@ void Camera2Client::disconnect() {
ALOGV("Camera %d: Shutting down", mCameraId);
- stopPreviewL();
+ 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);
+ }
{
SharedParameters::Lock l(mParameters);