diff options
Diffstat (limited to 'services/camera/libcameraservice/device3/Camera3ZslStream.cpp')
-rw-r--r-- | services/camera/libcameraservice/device3/Camera3ZslStream.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp index 92bf81b..81330ea 100644 --- a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp +++ b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp @@ -315,20 +315,24 @@ status_t Camera3ZslStream::enqueueInputBufferByTimestamp( return OK; } -status_t Camera3ZslStream::clearInputRingBuffer() { +status_t Camera3ZslStream::clearInputRingBuffer(nsecs_t* latestTimestamp) { Mutex::Autolock l(mLock); - return clearInputRingBufferLocked(); + return clearInputRingBufferLocked(latestTimestamp); } -status_t Camera3ZslStream::clearInputRingBufferLocked() { +status_t Camera3ZslStream::clearInputRingBufferLocked(nsecs_t* latestTimestamp) { + + if (latestTimestamp) { + *latestTimestamp = mProducer->getLatestTimestamp(); + } mInputBufferQueue.clear(); return mProducer->clear(); } status_t Camera3ZslStream::disconnectLocked() { - clearInputRingBufferLocked(); + clearInputRingBufferLocked(NULL); return Camera3OutputStream::disconnectLocked(); } |