From 690895cfe0f128ee3fc375a357ab99b0b98394b6 Mon Sep 17 00:00:00 2001 From: Yin-Chia Yeh Date: Wed, 27 Aug 2014 12:58:33 -0700 Subject: cameraservice: decrease zsl metadata queue size by 1 Zsl buffer needs to be longer than metadata queue to ensure that oldest metadata can always find a match in buffer queue. Since we don't want to add memory overhead, decrease metadata queue size by one serves the same purpose. bug 17264283 Change-Id: Ic53441cc29c98e57d3345f5845d92839d0ce6faf --- services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'services/camera') diff --git a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp index b388079..5cf69bd 100644 --- a/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp +++ b/services/camera/libcameraservice/api1/client2/ZslProcessor3.cpp @@ -78,8 +78,12 @@ ZslProcessor3::ZslProcessor3( ALOGV("%s: Initialize buffer queue and frame list depth based on max pipeline depth (%d)", __FUNCTION__, pipelineMaxDepth); - mBufferQueueDepth = pipelineMaxDepth + 1; - mFrameListDepth = pipelineMaxDepth + 1; + // Need to keep buffer queue longer than metadata queue because sometimes buffer arrives + // earlier than metadata which causes the buffer corresponding to oldest metadata being + // removed. + mFrameListDepth = pipelineMaxDepth; + mBufferQueueDepth = mFrameListDepth + 1; + mZslQueue.insertAt(0, mBufferQueueDepth); mFrameList.insertAt(0, mFrameListDepth); -- cgit v1.1