Skip to main content

AvSyncScheduler

Struct AvSyncScheduler 

Source
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.

Source

pub fn new_default() -> Self

Creates an initialized AvSyncScheduler starting at 0 us with 1.0x playback rate.

§Returns
  • Self - Ready scheduler.
Source

pub const fn last_presented_pts_us(&self) -> Option<i64>

Returns the PTS in microseconds of the most recently presented frame.

§Arguments
  • &Self - Scheduler reference.
§Returns
  • Option<i64> - Last presented PTS or None.
Source

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.
Source

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.
Source

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.
Source

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, or Ended.
Source§

impl AvSyncScheduler

Source

pub fn get_clock_source(&self) -> AvSyncClockSource

Source

pub fn get_mut_clock_source(&mut self) -> &mut AvSyncClockSource

Source

pub fn set_clock_source(&mut self, val: AvSyncClockSource) -> &mut Self

Source

pub fn get_clock_pts_us(&self) -> i64

Source

pub fn get_mut_clock_pts_us(&mut self) -> &mut i64

Source

pub fn set_clock_pts_us(&mut self, val: i64) -> &mut Self

Source

pub fn get_playback_rate(&self) -> f32

Source

pub fn get_mut_playback_rate(&mut self) -> &mut f32

Source

pub fn set_playback_rate(&mut self, val: f32) -> &mut Self

Source

pub fn get_max_late_us(&self) -> i64

Source

pub fn get_mut_max_late_us(&mut self) -> &mut i64

Source

pub fn set_max_late_us(&mut self, val: i64) -> &mut Self

Source

pub fn get_mut_last_presented_pts_us(&mut self) -> &mut Option<i64>

Source

pub fn set_last_presented_pts_us(&mut self, val: Option<i64>) -> &mut Self

Source

pub fn get_frames_presented(&self) -> u64

Source

pub fn get_mut_frames_presented(&mut self) -> &mut u64

Source

pub fn set_frames_presented(&mut self, val: u64) -> &mut Self

Source

pub fn get_frames_held_vsync(&self) -> u64

Source

pub fn get_mut_frames_held_vsync(&mut self) -> &mut u64

Source

pub fn set_frames_held_vsync(&mut self, val: u64) -> &mut Self

Source

pub fn get_frames_dropped_late(&self) -> u64

Source

pub fn get_mut_frames_dropped_late(&mut self) -> &mut u64

Source

pub fn set_frames_dropped_late(&mut self, val: u64) -> &mut Self

Trait Implementations§

Source§

impl Clone for AvSyncScheduler

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AvSyncScheduler

Source§

impl Debug for AvSyncScheduler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AvSyncScheduler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for AvSyncScheduler

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AvSyncScheduler

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.