Camera: Reduce latency for dejittering

There is a tradeoff between dejittering and latency. The more we delay
the presentation of frames, the longer latency there is.

- Only look ahead for 2 frames in the vsync timeline. And do not exceed
2+1 vsync timestamps when spacing out fixed frame rates in lockstep with
display vsync.
- Disable synchronizing presentation time to vsync for variable frame
rate. Fixed frame rate and video mode is typically more tolerant to
higher latency and prefers smoother user experience.
- Reduce the upper bound of holding onto buffers to 10ms.

Test: Measure photon-to-photon latency
Bug: 239775097
Change-Id: I601a0fadf89529922fd1bd5d0a17ba80832b4cab
diff --git a/services/camera/libcameraservice/device3/PreviewFrameSpacer.cpp b/services/camera/libcameraservice/device3/PreviewFrameSpacer.cpp
index 67f42b4..b3cb178 100644
--- a/services/camera/libcameraservice/device3/PreviewFrameSpacer.cpp
+++ b/services/camera/libcameraservice/device3/PreviewFrameSpacer.cpp
@@ -68,7 +68,7 @@
         return true;
     }
 
-    // Cache the frame to match readout time interval, for up to 33ms
+    // Cache the frame to match readout time interval, for up to kMaxFrameWaitTime
     nsecs_t expectedQueueTime = mLastCameraPresentTime + readoutInterval;
     nsecs_t frameWaitTime = std::min(kMaxFrameWaitTime, expectedQueueTime - currentTime);
     if (frameWaitTime > 0 && mPendingBuffers.size() < 2) {