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

Commit dcb1770a authored by Brian Lindahl's avatar Brian Lindahl Committed by Automerger Merge Worker
Browse files

Merge "Process skipped frames the correct order, per content time" into main...

Merge "Process skipped frames the correct order, per content time" into main am: 23e9c391 am: 4ffc1761

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



Change-Id: Ic3627752a7d4f5c962622b5d4bd01deb29b52ed7
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f97521e0 4ffc1761
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -302,13 +302,6 @@ void VideoRenderQualityTracker::onFrameRendered(int64_t contentTimeUs, int64_t a
        mRenderDurationMs += (actualRenderTimeUs - mLastRenderTimeUs) / 1000;
    }

    // Now that a frame has been rendered, the previously skipped frames can be processed as skipped
    // frames since the app is not skipping them to terminate playback.
    for (int64_t contentTimeUs : mPendingSkippedFrameContentTimeUsList) {
        processMetricsForSkippedFrame(contentTimeUs);
    }
    mPendingSkippedFrameContentTimeUsList = {};

    // We can render a pending queued frame if it's the last frame of the video, so release it
    // immediately.
    if (contentTimeUs == mTunnelFrameQueuedContentTimeUs && mTunnelFrameQueuedContentTimeUs != -1) {
@@ -332,9 +325,25 @@ void VideoRenderQualityTracker::onFrameRendered(int64_t contentTimeUs, int64_t a
                  (long long) contentTimeUs, (long long) nextExpectedFrame.contentTimeUs);
            break;
        }
        // Process all skipped frames before the dropped frame.
        while (!mPendingSkippedFrameContentTimeUsList.empty()) {
            if (mPendingSkippedFrameContentTimeUsList.front() >= nextExpectedFrame.contentTimeUs) {
                break;
            }
            processMetricsForSkippedFrame(mPendingSkippedFrameContentTimeUsList.front());
            mPendingSkippedFrameContentTimeUsList.pop_front();
        }
        processMetricsForDroppedFrame(nextExpectedFrame.contentTimeUs,
                                      nextExpectedFrame.desiredRenderTimeUs);
    }
    // Process all skipped frames before the rendered frame.
    while (!mPendingSkippedFrameContentTimeUsList.empty()) {
        if (mPendingSkippedFrameContentTimeUsList.front() >= nextExpectedFrame.contentTimeUs) {
            break;
        }
        processMetricsForSkippedFrame(mPendingSkippedFrameContentTimeUsList.front());
        mPendingSkippedFrameContentTimeUsList.pop_front();
    }
    processMetricsForRenderedFrame(nextExpectedFrame.contentTimeUs,
                                   nextExpectedFrame.desiredRenderTimeUs, actualRenderTimeUs,
                                   freezeEventOut, judderEventOut);