summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-05-28 16:51:18 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-05-28 16:51:18 -0700
commit8bae43ae86b9942892980c3c01bff5c812b1db7f (patch)
tree70b0ea93507a38f5b761f07bb357a7c19eb2e3a4 /services/camera
parent88a0abacb1de24000d2e8db8b0132b4afd731225 (diff)
parent9f013a46e150da01ebb267574d8095eef399cd0c (diff)
downloadframeworks_av-8bae43ae86b9942892980c3c01bff5c812b1db7f.zip
frameworks_av-8bae43ae86b9942892980c3c01bff5c812b1db7f.tar.gz
frameworks_av-8bae43ae86b9942892980c3c01bff5c812b1db7f.tar.bz2
am 9f013a46: am 3c89a2e9: Merge "camera3: Don\'t try to disconnect stream native windows more than once" into jb-mr2-dev
* commit '9f013a46e150da01ebb267574d8095eef399cd0c': camera3: Don't try to disconnect stream native windows more than once
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/Camera3Device.cpp2
-rw-r--r--services/camera/libcameraservice/camera3/Camera3IOStreamBase.cpp4
-rw-r--r--services/camera/libcameraservice/camera3/Camera3Stream.cpp10
-rw-r--r--services/camera/libcameraservice/camera3/Camera3Stream.h1
4 files changed, 15 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/Camera3Device.cpp b/services/camera/libcameraservice/Camera3Device.cpp
index 1d38993..0b5e9c4 100644
--- a/services/camera/libcameraservice/Camera3Device.cpp
+++ b/services/camera/libcameraservice/Camera3Device.cpp
@@ -677,6 +677,8 @@ status_t Camera3Device::deleteStream(int id) {
Mutex::Autolock l(mLock);
status_t res;
+ ALOGV("%s: Camera %d: Deleting stream %d", __FUNCTION__, mId, id);
+
// CameraDevice semantics require device to already be idle before
// deleteStream is called, unlike for createStream.
if (mStatus != STATUS_IDLE) {
diff --git a/services/camera/libcameraservice/camera3/Camera3IOStreamBase.cpp b/services/camera/libcameraservice/camera3/Camera3IOStreamBase.cpp
index abc28fe..0850566 100644
--- a/services/camera/libcameraservice/camera3/Camera3IOStreamBase.cpp
+++ b/services/camera/libcameraservice/camera3/Camera3IOStreamBase.cpp
@@ -159,7 +159,9 @@ status_t Camera3IOStreamBase::disconnectLocked() {
break;
default:
// No connection, nothing to do
- return OK;
+ ALOGV("%s: Stream %d: Already disconnected",
+ __FUNCTION__, mId);
+ return -ENOTCONN;
}
if (mDequeuedBufferCount > 0) {
diff --git a/services/camera/libcameraservice/camera3/Camera3Stream.cpp b/services/camera/libcameraservice/camera3/Camera3Stream.cpp
index 9c9c258..f05658a 100644
--- a/services/camera/libcameraservice/camera3/Camera3Stream.cpp
+++ b/services/camera/libcameraservice/camera3/Camera3Stream.cpp
@@ -258,7 +258,15 @@ bool Camera3Stream::hasOutstandingBuffers() const {
status_t Camera3Stream::disconnect() {
ATRACE_CALL();
Mutex::Autolock l(mLock);
- return disconnectLocked();
+ ALOGV("%s: Stream %d: Disconnecting...", __FUNCTION__, mId);
+ status_t res = disconnectLocked();
+
+ if (res == -ENOTCONN) {
+ // "Already disconnected" -- not an error
+ return OK;
+ } else {
+ return res;
+ }
}
status_t Camera3Stream::registerBuffersLocked(camera3_device *hal3Device) {
diff --git a/services/camera/libcameraservice/camera3/Camera3Stream.h b/services/camera/libcameraservice/camera3/Camera3Stream.h
index 4b3b346..69d81e4 100644
--- a/services/camera/libcameraservice/camera3/Camera3Stream.h
+++ b/services/camera/libcameraservice/camera3/Camera3Stream.h
@@ -251,6 +251,7 @@ class Camera3Stream :
virtual status_t returnInputBufferLocked(
const camera3_stream_buffer &buffer);
virtual bool hasOutstandingBuffersLocked() const = 0;
+ // Can return -ENOTCONN when we are already disconnected (not an error)
virtual status_t disconnectLocked() = 0;
// Configure the buffer queue interface to the other end of the stream,