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

Commit a0165f57 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Camera: Allow error frame number gaps" into main

parents b641d53b 7162e78b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -90,6 +90,22 @@ public class FrameNumberTracker {
                        break;
                    }
                }

                if (!removeError) {
                    // Check for the case where we might have an error after a frame number gap
                    // caused by other types of capture requests
                    int otherType1 = (requestType + 1) % CaptureRequest.REQUEST_TYPE_COUNT;
                    int otherType2 = (requestType + 2) % CaptureRequest.REQUEST_TYPE_COUNT;
                    if (mPendingFrameNumbersWithOtherType[otherType1].isEmpty() &&
                            mPendingFrameNumbersWithOtherType[otherType2].isEmpty()) {
                        long errorGapNumber = Math.max(mCompletedFrameNumber[otherType1],
                                mCompletedFrameNumber[otherType2]) + 1;
                        if ((errorGapNumber > mCompletedFrameNumber[requestType] + 1) &&
                                (errorGapNumber == errorFrameNumber)) {
                            removeError = true;
                        }
                    }
                }
            }
            if (removeError) {
                mCompletedFrameNumber[requestType] = errorFrameNumber;