Realm

oa::MediaPlayer

Synchronized playback session over independent audio and video owners. The caller ticks video on the Engine-owning thread. During the audio segment, the device output clock paces decoded video. The host clock covers silent lead-in and the tail after audio drains. A presented native frame retains its decoder backing until it is replaced and any external GPU consumers retire.

StRust public API

Declaration

pub struct MediaPlayer { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn play(&mut self) -> Result<()>
pub fn pause(&mut self) -> Result<()>
pub fn tick(&mut self, max_frames: u32) -> Result<u32>
pub fn seek_us(&mut self, timestamp_us: u64) -> Result<()>
pub fn current_frame(&self) -> Result<&VideoFrame>
pub fn position_us(&self) -> Result<u64>
pub fn is_playing(&self) -> bool
pub fn is_done(&self) -> bool
pub fn close(&mut self) -> Result<()>

Associated Functions

pub fn open(engine: &Engine, config: MediaPlayerConfig) -> Result<Self>

Public Method Documentation

pub fn play(&mut self) -> Result<()>
Open both tracks paused, with the first video frame decoded. Errors Requires a supported video stream, both track sources, and an audio output configuration that can play the selected PCM.
pub fn pause(&mut self) -> Result<()>
Open both tracks paused, with the first video frame decoded. Errors Requires a supported video stream, both track sources, and an audio output configuration that can play the selected PCM.
pub fn tick( &mut self, max_frames: u32 ) -> Result<u32>
No public source comment is attached to this declaration.
pub fn seek_us(&mut self, timestamp_us: u64) -> Result<()>
No public source comment is attached to this declaration.
pub fn current_frame( &self ) -> Result<&VideoFrame>
Open both tracks paused, with the first video frame decoded. Errors Requires a supported video stream, both track sources, and an audio output configuration that can play the selected PCM.
pub fn position_us( &self ) -> Result<u64>
Open both tracks paused, with the first video frame decoded. Errors Requires a supported video stream, both track sources, and an audio output configuration that can play the selected PCM.
pub fn is_playing( &self ) -> bool
Open both tracks paused, with the first video frame decoded. Errors Requires a supported video stream, both track sources, and an audio output configuration that can play the selected PCM.
pub fn is_done( &self ) -> bool
Open both tracks paused, with the first video frame decoded. Errors Requires a supported video stream, both track sources, and an audio output configuration that can play the selected PCM.
pub fn close(&mut self) -> Result<()>
Open both tracks paused, with the first video frame decoded. Errors Requires a supported video stream, both track sources, and an audio output configuration that can play the selected PCM.
pub fn open( engine: &Engine, config: MediaPlayerConfig ) -> Result<Self>
No public source comment is attached to this declaration.