pub struct AvSyncScheduler { /* private fields */ }Expand description
Audio-master / monotonic-clock A/V synchronization scheduler that preserves source video cadence without forging frames on high-refresh displays.
Implementations§
Source§impl AvSyncScheduler
Audio-master / monotonic clock A/V synchronization and cadence-preserving frame selection for AvSyncScheduler.
impl AvSyncScheduler
Audio-master / monotonic clock A/V synchronization and cadence-preserving frame selection for AvSyncScheduler.
Sourcepub fn new_default() -> Self
pub fn new_default() -> Self
Creates an initialized AvSyncScheduler starting at 0 us with 1.0x playback rate.
§Returns
Self- Ready scheduler.
Sourcepub const fn last_presented_pts_us(&self) -> Option<i64>
pub const fn last_presented_pts_us(&self) -> Option<i64>
Sourcepub fn update_audio_clock_us(&mut self, audio_pts_us: i64)
pub fn update_audio_clock_us(&mut self, audio_pts_us: i64)
Switches to AudioMaster synchronization and updates the active clock position from hardware audio playback.
§Arguments
&Self- Mutable scheduler.i64- Current hardware audio playback timestamp in microseconds.
Sourcepub fn advance_monotonic_us(&mut self, delta_us: u64)
pub fn advance_monotonic_us(&mut self, delta_us: u64)
Advances the fallback monotonic clock by delta_us * playback_rate when audio master is inactive or muted.
§Arguments
&Self- Mutable scheduler.u64- Elapsed wall display delta in microseconds.
Sourcepub fn reset_for_seek(&mut self, target_pts_us: i64)
pub fn reset_for_seek(&mut self, target_pts_us: i64)
Resets the scheduler clock directly to target_pts_us after a seek discontinuity.
§Arguments
&Self- Mutable scheduler.i64- New target playback timestamp in microseconds.
Sourcepub fn select_frame_for_vsync(
&mut self,
queue: &mut PtsFrameQueue,
pool: &VideoFramePool,
reached_eos: bool,
has_displayed_frame: bool,
) -> VideoPresentDecision
pub fn select_frame_for_vsync( &mut self, queue: &mut PtsFrameQueue, pool: &VideoFramePool, reached_eos: bool, has_displayed_frame: bool, ) -> VideoPresentDecision
Selects the frame due for presentation on the current VSync tick without ever forging new frames when display Hz exceeds video FPS.
§Arguments
&Self- Mutable scheduler.&mut PtsFrameQueue- Bounded PTS-ordered decoded frame queue.&VideoFramePool- Pool receiving any dropped late CPU frames.bool- Whether the decoder has reached end-of-stream.bool- Whether a frame is already currently displayed on screen.
§Returns
VideoPresentDecision-PresentNewFrame,HoldCurrentFrame,Buffering, orEnded.