fix: isolate front YUV640 camera session and report native readiness

This commit is contained in:
zenord
2026-10-13 18:31:25 +08:00
parent e5a7e87f25
commit 4010675f8c
12 changed files with 194 additions and 110 deletions
+10 -8
View File
@@ -18,18 +18,20 @@ fun main() {
check(cameraTimeout(boot.snapshot(),28000)==CameraFailure.PROVIDER_TIMEOUT)
boot.stage(CameraStage.WAITING_FRAME,30000)
check(cameraTimeout(boot.snapshot(),34999)==CameraFailure.NONE)
check(canRecoverFirstFrame(boot.snapshot(),cameraTimeout(boot.snapshot(),35000)))
check(canRecoverFirstFrame(boot.snapshot(),CameraFailure.STREAM_CONFIG))
boot.recovering();check(boot.snapshot().profile==CameraProfile.YUV_320)
check(!canRecoverFirstFrame(boot.snapshot(),CameraFailure.STREAM_CONFIG))
boot.stage(CameraStage.WAITING_FRAME,35000)
check(!canRecoverFirstFrame(boot.snapshot(),cameraTimeout(boot.snapshot(),40000)))
check(cameraTimeout(boot.snapshot(),35000)==CameraFailure.FRAME_TIMEOUT)
check(boot.snapshot().profile==CameraProfile.YUV_640 && boot.snapshot().recoveries==0)
boot.binding(30000)
boot.nativeState(CameraNativeState.OPEN,30200)
check(boot.snapshot().nativeState==CameraNativeState.OPEN && boot.snapshot().nativeStateSinceMs==30200L)
check(boot.snapshot().processed==0 && boot.snapshot().firstFrameMs == -1L) // OPEN is not frame readiness.
boot.received(39000)
boot.received(39100)
check(boot.snapshot().firstFrameMs==39000L && boot.snapshot().bindStartedMs==30000L)
check(boot.snapshot().stage==CameraStage.WAITING_RESULT)
check(cameraTimeout(boot.snapshot(),44000)==CameraFailure.RESULT_TIMEOUT)
boot.processed(0,FaceCueObservation(reason=FaceCueReason.NO_FACE),10,40000)
check(boot.snapshot().stage==CameraStage.READY && boot.snapshot().processed==1)
check(cameraTimeout(boot.snapshot(),44000)==CameraFailure.FRAME_TIMEOUT)
check(cameraTimeout(boot.snapshot(),44100)==CameraFailure.FRAME_TIMEOUT)
boot.received(44500)
check(cameraTimeout(boot.snapshot(),45000)==CameraFailure.RESULT_TIMEOUT)
boot.stage(CameraStage.OFF,45000)
@@ -64,5 +66,5 @@ fun main() {
send.record(FaceSendReason.STALE)
check(send.snapshot().attempts == 3 && send.snapshot().sent == 1 && send.snapshot().clears == 1 && send.snapshot().failures == 1)
check(send.summary(0) != null && send.summary(9999) == null && send.summary(10000) != null)
println("PASS: production camera readiness deadlines/one bounded first-frame recovery/no-frame vs no-result/stale/stop; enum-only counters and 10s summaries")
println("PASS: production camera readiness deadlines/single YUV attempt/native-open is not readiness/no-frame vs no-result/stale/stop; enum-only counters and 10s summaries")
}