Loading services/camera/libcameraservice/camera2/CaptureSequencer.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,11 @@ CaptureSequencer::CaptureState CaptureSequencer::manageDone(sp<Camera2Client> &c res = INVALID_OPERATION; } } sp<ZslProcessor> processor = mZslProcessor.promote(); if (processor != 0) { processor->clearZslQueue(); } if (mCaptureBuffer != 0 && res == OK) { Camera2Client::SharedCameraClient::Lock l(client->mSharedCameraClient); ALOGV("%s: Sending still image to client", __FUNCTION__); Loading services/camera/libcameraservice/camera2/ZslProcessor.cpp +24 −1 Original line number Diff line number Diff line Loading @@ -97,6 +97,10 @@ void ZslProcessor::onBufferReleased(buffer_handle_t *handle) { __FUNCTION__, handle); } // Erase entire ZSL queue since we've now completed the capture and preview // is stopped. clearZslQueueLocked(); mState = RUNNING; } Loading Loading @@ -240,7 +244,6 @@ status_t ZslProcessor::pushToReprocess(int32_t requestId) { dumpZslQueue(-1); } if (mZslQueueTail != mZslQueueHead) { CameraMetadata request; size_t index = mZslQueueTail; Loading Loading @@ -312,6 +315,26 @@ status_t ZslProcessor::pushToReprocess(int32_t requestId) { return OK; } status_t ZslProcessor::clearZslQueue() { Mutex::Autolock l(mInputMutex); // If in middle of capture, can't clear out queue if (mState == LOCKED) return OK; return clearZslQueueLocked(); } status_t ZslProcessor::clearZslQueueLocked() { for (size_t i = 0; i < mZslQueue.size(); i++) { if (mZslQueue[i].buffer.mTimestamp != 0) { mZslConsumer->releaseBuffer(mZslQueue[i].buffer); } mZslQueue.replaceAt(i); } mZslQueueHead = 0; mZslQueueTail = 0; return OK; } void ZslProcessor::dump(int fd, const Vector<String16>& args) const { Mutex::Autolock l(mInputMutex); dumpZslQueue(fd); Loading services/camera/libcameraservice/camera2/ZslProcessor.h +3 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class ZslProcessor: int getReprocessStreamId() const; status_t pushToReprocess(int32_t requestId); status_t clearZslQueue(); void dump(int fd, const Vector<String16>& args) const; private: Loading Loading @@ -111,6 +112,8 @@ class ZslProcessor: // Match up entries from frame list to buffers in ZSL queue void findMatchesLocked(); status_t clearZslQueueLocked(); void dumpZslQueue(int id) const; }; Loading Loading
services/camera/libcameraservice/camera2/CaptureSequencer.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,11 @@ CaptureSequencer::CaptureState CaptureSequencer::manageDone(sp<Camera2Client> &c res = INVALID_OPERATION; } } sp<ZslProcessor> processor = mZslProcessor.promote(); if (processor != 0) { processor->clearZslQueue(); } if (mCaptureBuffer != 0 && res == OK) { Camera2Client::SharedCameraClient::Lock l(client->mSharedCameraClient); ALOGV("%s: Sending still image to client", __FUNCTION__); Loading
services/camera/libcameraservice/camera2/ZslProcessor.cpp +24 −1 Original line number Diff line number Diff line Loading @@ -97,6 +97,10 @@ void ZslProcessor::onBufferReleased(buffer_handle_t *handle) { __FUNCTION__, handle); } // Erase entire ZSL queue since we've now completed the capture and preview // is stopped. clearZslQueueLocked(); mState = RUNNING; } Loading Loading @@ -240,7 +244,6 @@ status_t ZslProcessor::pushToReprocess(int32_t requestId) { dumpZslQueue(-1); } if (mZslQueueTail != mZslQueueHead) { CameraMetadata request; size_t index = mZslQueueTail; Loading Loading @@ -312,6 +315,26 @@ status_t ZslProcessor::pushToReprocess(int32_t requestId) { return OK; } status_t ZslProcessor::clearZslQueue() { Mutex::Autolock l(mInputMutex); // If in middle of capture, can't clear out queue if (mState == LOCKED) return OK; return clearZslQueueLocked(); } status_t ZslProcessor::clearZslQueueLocked() { for (size_t i = 0; i < mZslQueue.size(); i++) { if (mZslQueue[i].buffer.mTimestamp != 0) { mZslConsumer->releaseBuffer(mZslQueue[i].buffer); } mZslQueue.replaceAt(i); } mZslQueueHead = 0; mZslQueueTail = 0; return OK; } void ZslProcessor::dump(int fd, const Vector<String16>& args) const { Mutex::Autolock l(mInputMutex); dumpZslQueue(fd); Loading
services/camera/libcameraservice/camera2/ZslProcessor.h +3 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,7 @@ class ZslProcessor: int getReprocessStreamId() const; status_t pushToReprocess(int32_t requestId); status_t clearZslQueue(); void dump(int fd, const Vector<String16>& args) const; private: Loading Loading @@ -111,6 +112,8 @@ class ZslProcessor: // Match up entries from frame list to buffers in ZSL queue void findMatchesLocked(); status_t clearZslQueueLocked(); void dumpZslQueue(int id) const; }; Loading