docs/android/dokka/filament-android/com.google.android.filament.android/-frame-pacer/setup-frame.md
//filament-android/com.google.android.filament.android/FramePacer/setupFrame
[main]
open fun setupFrame(frameTimeNanos: Long, vsyncPeriodNanos: Long): FramePacer.FrameStatus
Prepares and evaluates the frame pacing state for the upcoming frame cycle.
This must be called at the very beginning of the host display platform's VSYNC interrupt loop (e.g., within Android's Choreographer callback). It evaluates whether the CPU rendering thread is ahead of the hardware pulse cadence or backlogged.
FrameStatus::ACCEPTED if approved, or the specific SKIPPED reason.
main
| frameTimeNanos | Incoming hardware base VSYNC timestamp in nanoseconds. |
| vsyncPeriodNanos | Physical display VSYNC refresh period in nanoseconds. |
[main]
open fun setupFrame(frameTimeNanos: Long): FramePacer.FrameStatus
Prepares and evaluates the frame pacing state for the upcoming frame cycle.
This must be called at the very beginning of the host display platform's VSYNC interrupt loop (e.g., within Android's Choreographer callback). It evaluates whether the CPU rendering thread is ahead of the hardware pulse cadence or backlogged.
FrameStatus::ACCEPTED if approved, or the specific SKIPPED reason.
main
| frameTimeNanos | Incoming hardware base VSYNC timestamp in nanoseconds. |
[main]
open fun setupFrame(frameData: FrameData, vsyncPeriodNanos: Long): FramePacer.FrameStatus
Prepares and evaluates the frame pacing state for the upcoming frame cycle using Android 13+ FrameData.
This must be called at the very beginning of the host display platform's VSYNC interrupt loop (e.g., within Android's Choreographer callback). It evaluates whether the CPU rendering thread is ahead of the hardware pulse cadence or backlogged.
FrameStatus::ACCEPTED if approved, or the specific SKIPPED reason.
main
| frameData | Native VSYNC telemetry object received in an Android 13+ Choreographer.VsyncCallback. |
| vsyncPeriodNanos | Physical display VSYNC refresh period in nanoseconds. |