Camera: Handle deviation between frame duration and vsync intervals
When camera frame duration deviates from display vsync interval, the
current approach doesn't work because it favors delaying the frames to
latch onto next VSYNC interval.
We cannot compensate such delay by pulling in and latching onto an
ealier VSYNC signal. That will result in periods where frames are
displayed at 16ms, 50ms, 16ms, 50ms intervals for 30fps case.
The solution is to use different methods for different cases:
1. If the frame duration is multiples of VSYNC intervals, use existing
approach.
2. Otherwise, simply use the earlist expected presentation time in the
VSYNC timeline.
Test: Run camera at lower FPS (24) and observe trace
Test: No regression for fixed 30fps or 60fps use cases
Test: Vendor verifies 24/30/60 fps display rate on different SoC chips
Test: PerformanceTest#testSurfaceViewJitterReduction
Bug: 236389092
Change-Id: I5408192550a1e09b18c4c0aa255a7687bf5dd829
2 files changed