ALOGV("DEBUG(%s): frameCnt(%d)", __FUNCTION__, shot_ext->shot.ctl.request.frameCount);
for (i = 0 ; i < NUM_MAX_REQUEST_MGR_ENTRY ; i++) {
- if((entries[i].internal_shot.shot.ctl.request.frameCount == shot_ext->shot.ctl.request.frameCount)
- && (entries[i].status == CAPTURED)){
- entries[i].status = METADONE;
- break;
+ if (entries[i].internal_shot.shot.ctl.request.frameCount
+ == shot_ext->shot.ctl.request.frameCount) {
+ if (entries[i].status == CAPTURED) {
+ entries[i].status = METADONE;
+ break;
+ }
+ if (entries[i].status == METADONE) {
+ return;
+ }
}
}
return ¤tEntry->internal_shot;
}
-int RequestManager::FindFrameCnt(struct camera2_shot_ext * shot_ext)
+int RequestManager::FindFrameCnt(struct camera2_shot_ext * shot_ext, bool drain)
{
Mutex::Autolock lock(m_requestMutex);
+ Mutex::Autolock lock2(m_numOfEntriesLock);
int i;
if (m_numOfEntries == 0) {
entries[i].status = CAPTURED;
return entries[i].internal_shot.shot.ctl.request.frameCount;
}
+ if (drain && (entries[i].status >= CAPTURED)) {
+ return entries[i].internal_shot.shot.ctl.request.frameCount;
+ }
CAM_LOGE("ERR(%s): frameCount(%d), index(%d), status(%d)", __FUNCTION__, shot_ext->shot.ctl.request.frameCount, i, entries[i].status);
}
matchedFrameCnt = m_ctlInfo.flash.m_flashFrameCount;
ALOGV("Skip frame, request is fixed at %d", matchedFrameCnt);
} else {
- matchedFrameCnt = m_requestManager->FindFrameCnt(shot_ext);
+ matchedFrameCnt = m_requestManager->FindFrameCnt(shot_ext, m_isRequestQueueNull);
}
if (matchedFrameCnt == -1 && m_vdisBubbleCnt > 0) {
uint8_t GetOutputStream(int index);
camera2_shot_ext * GetInternalShotExtByFrameCnt(int frameCnt);
camera2_shot_ext * GetInternalShotExt(int index);
- int FindFrameCnt(struct camera2_shot_ext * shot_ext);
+ int FindFrameCnt(struct camera2_shot_ext * shot_ext, bool drain);
bool IsVdisEnable(void);
int FindEntryIndexByFrameCnt(int frameCnt);
void Dump(void);