diff options
author | Zhijun He <zhijunhe@google.com> | 2014-07-24 13:45:15 -0700 |
---|---|---|
committer | Zhijun He <zhijunhe@google.com> | 2014-07-24 15:40:16 -0700 |
commit | 0a21051b91c2e07e49eb6fa568c505aee967ab9d (patch) | |
tree | e5f844d8863a19fc11b5057645dbfe720bf1f57c /services/camera/libcameraservice/device3 | |
parent | 81e50d0c782cc18eab4ef40ecd6c7f36df50fea5 (diff) | |
download | frameworks_av-0a21051b91c2e07e49eb6fa568c505aee967ab9d.zip frameworks_av-0a21051b91c2e07e49eb6fa568c505aee967ab9d.tar.gz frameworks_av-0a21051b91c2e07e49eb6fa568c505aee967ab9d.tar.bz2 |
Camera3: tear down Camera3 streams when they are deleted.
Also override the disconnectLocked method in Camera3ZslStream to make sure the
Camera3ZslStream specific buffer queue is cleaned up properly.
Also revert 0be123df1897fd3fe1b7ba30f24d8ae4c91b4dc7, as it was not the right
fix.
Change-Id: I89bdcb2e206379ae1f2602421e7fdbcde9a31399
Diffstat (limited to 'services/camera/libcameraservice/device3')
4 files changed, 21 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp index 9d36bfa..44e8822 100644 --- a/services/camera/libcameraservice/device3/Camera3Device.cpp +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp @@ -1497,6 +1497,9 @@ status_t Camera3Device::configureStreamsLocked() { ALOGV("%s: Camera %d: Stream configuration complete", __FUNCTION__, mId); + // tear down the deleted streams after configure streams. + mDeletedStreams.clear(); + return OK; } diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.h b/services/camera/libcameraservice/device3/Camera3OutputStream.h index 6cbb9f4..f963326 100644 --- a/services/camera/libcameraservice/device3/Camera3OutputStream.h +++ b/services/camera/libcameraservice/device3/Camera3OutputStream.h @@ -76,6 +76,8 @@ class Camera3OutputStream : /*out*/ sp<Fence> *releaseFenceOut); + virtual status_t disconnectLocked(); + sp<ANativeWindow> mConsumer; private: int mTransform; @@ -91,7 +93,6 @@ class Camera3OutputStream : nsecs_t timestamp); virtual status_t configureQueueLocked(); - virtual status_t disconnectLocked(); virtual status_t getEndpointUsage(uint32_t *usage); diff --git a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp index 6c298f9..92bf81b 100644 --- a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp +++ b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp @@ -318,11 +318,21 @@ status_t Camera3ZslStream::enqueueInputBufferByTimestamp( status_t Camera3ZslStream::clearInputRingBuffer() { Mutex::Autolock l(mLock); + return clearInputRingBufferLocked(); +} + +status_t Camera3ZslStream::clearInputRingBufferLocked() { mInputBufferQueue.clear(); return mProducer->clear(); } +status_t Camera3ZslStream::disconnectLocked() { + clearInputRingBufferLocked(); + + return Camera3OutputStream::disconnectLocked(); +} + status_t Camera3ZslStream::setTransform(int /*transform*/) { ALOGV("%s: Not implemented", __FUNCTION__); return INVALID_OPERATION; diff --git a/services/camera/libcameraservice/device3/Camera3ZslStream.h b/services/camera/libcameraservice/device3/Camera3ZslStream.h index 6721832..d89c38d 100644 --- a/services/camera/libcameraservice/device3/Camera3ZslStream.h +++ b/services/camera/libcameraservice/device3/Camera3ZslStream.h @@ -96,6 +96,12 @@ class Camera3ZslStream : bool output, /*out*/ sp<Fence> *releaseFenceOut); + + // Disconnet the Camera3ZslStream specific bufferQueues. + virtual status_t disconnectLocked(); + + status_t clearInputRingBufferLocked(); + }; // class Camera3ZslStream }; // namespace camera3 |