Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c90e9fd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Camera: Fix rounding issue with minInterval" into tm-dev am: 24eb57be...

Merge "Camera: Fix rounding issue with minInterval" into tm-dev am: 24eb57be am: c5c79c8a am: a27a3367

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/18484360



Change-Id: Iaa6105a052dcdd788dc452e54d12f4d5c6b21a70
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a96e800e a27a3367
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -1416,9 +1416,13 @@ nsecs_t Camera3OutputStream::syncTimestampToDisplayLocked(nsecs_t t) {
    nsecs_t expectedPresentT = mLastPresentTime;
    nsecs_t minDiff = INT64_MAX;
    // Derive minimum intervals between presentation times based on minimal
    // expected duration.
    size_t minVsyncs = (mMinExpectedDuration + vsyncEventData.frameInterval - 1) /
            vsyncEventData.frameInterval - 1;
    // expected duration. The minimum number of Vsyncs is:
    // - 0 if minFrameDuration in (0, 1.5] * vSyncInterval,
    // - 1 if minFrameDuration in (1.5, 2.5] * vSyncInterval,
    // - and so on.
    int minVsyncs = (mMinExpectedDuration - vsyncEventData.frameInterval / 2) /
            vsyncEventData.frameInterval;
    if (minVsyncs < 0) minVsyncs = 0;
    nsecs_t minInterval = minVsyncs * vsyncEventData.frameInterval + kTimelineThresholdNs;
    // Find best timestamp in the vsync timeline:
    // - closest to the ideal present time,