summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/api1/client2
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2014-09-12 16:47:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-12 16:47:12 +0000
commit095da43dfe840f28d8c026710644a97d9b7805bf (patch)
tree34ead87cf35b671acec18ac383d412484b09782f /services/camera/libcameraservice/api1/client2
parent3b54aba0883bdc5924290f44db8beb70da70ea26 (diff)
parent6b7a2294b9e4da784cfe4b562ee1720ad606c852 (diff)
downloadframeworks_av-095da43dfe840f28d8c026710644a97d9b7805bf.zip
frameworks_av-095da43dfe840f28d8c026710644a97d9b7805bf.tar.gz
frameworks_av-095da43dfe840f28d8c026710644a97d9b7805bf.tar.bz2
Merge "camera2: skip capture result after clearZslQueue" into lmp-dev
Diffstat (limited to 'services/camera/libcameraservice/api1/client2')
-rw-r--r--services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp7
-rw-r--r--services/camera/libcameraservice/api1/client2/ZslProcessor3.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
index 2d31275..227b169 100644
--- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
+++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp
@@ -44,6 +44,7 @@ ZslProcessor3::ZslProcessor3(
sp<Camera2Client> client,
wp<CaptureSequencer> sequencer):
Thread(false),
+ mLatestClearedBufferTimestamp(0),
mState(RUNNING),
mClient(client),
mSequencer(sequencer),
@@ -107,7 +108,6 @@ void ZslProcessor3::onResultAvailable(const CaptureResult &result) {
ALOGE("%s: metadata doesn't have timestamp, skip this result", __FUNCTION__);
return;
}
- (void)timestamp;
entry = result.mMetadata.find(ANDROID_REQUEST_FRAME_COUNT);
if (entry.count == 0) {
@@ -120,6 +120,9 @@ void ZslProcessor3::onResultAvailable(const CaptureResult &result) {
if (mState != RUNNING) return;
+ // Corresponding buffer has been cleared. No need to push into mFrameList
+ if (timestamp <= mLatestClearedBufferTimestamp) return;
+
mFrameList.editItemAt(mFrameListHead) = result.mMetadata;
mFrameListHead = (mFrameListHead + 1) % mFrameListDepth;
}
@@ -392,7 +395,7 @@ status_t ZslProcessor3::clearZslQueueLocked() {
if (mZslStream != 0) {
// clear result metadata list first.
clearZslResultQueueLocked();
- return mZslStream->clearInputRingBuffer();
+ return mZslStream->clearInputRingBuffer(&mLatestClearedBufferTimestamp);
}
return OK;
}
diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.h b/services/camera/libcameraservice/api1/client2/ZslProcessor3.h
index daa352b..8894364 100644
--- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.h
+++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.h
@@ -82,6 +82,7 @@ class ZslProcessor3 :
private:
static const nsecs_t kWaitDuration = 10000000; // 10 ms
+ nsecs_t mLatestClearedBufferTimestamp;
enum {
RUNNING,