|
|
@ -83,6 +83,9 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
private static final int PREFER_WIDTH = SingleBaseConfig.getBaseConfig().getRgbAndNirWidth(); |
|
|
|
private static final int PERFER_HEIGH = SingleBaseConfig.getBaseConfig().getRgbAndNirHeight(); |
|
|
|
|
|
|
|
// private static final int PREFER_WIDTH = 1280; |
|
|
|
// private static final int PERFER_HEIGH = 800; |
|
|
|
|
|
|
|
// 新增控制变量 |
|
|
|
private static int PROCESS_FRAME_INTERVAL = 3; // 快速处理频率,每隔3帧处理一次 |
|
|
|
private int frameCounter = 0; |
|
|
@ -1234,7 +1237,7 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
if (frameCounter % PROCESS_FRAME_INTERVAL == 0 && |
|
|
|
(currentTime - lastProcessTime) > MIN_PROCESS_INTERVAL) { |
|
|
|
|
|
|
|
Log.d(TAG, "满足条件: 0000000:"+isNeedCamera); |
|
|
|
Log.d(TAG, "满足条件: 0000000:"+isNeedCamera+"|"+needSendFaceImage); |
|
|
|
lastProcessTime = currentTime; |
|
|
|
// Log.d(TAG, "onGetCameraData: 666:"+FaceSDKManager.initStatus+"帧数阈值:"+SingleBaseConfig.getBaseConfig().getFramesThreshold()); |
|
|
|
// 检查应用是否处于前台 |
|
|
@ -1292,7 +1295,7 @@ public class OXFaceOnlineActivity extends BaseActivity implements View.OnClickLi |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (frameCounter % 30 == 0) { |
|
|
|
} else if (frameCounter % 30 == 0 && isApplicationInForeground()) { |
|
|
|
Log.e(TAG, "每30帧清空一次画布: 11111:"); |
|
|
|
// 对于跳过处理的帧,每30帧清空一次画布,确保无人脸时画面干净 |
|
|
|
try { |
|
|
|