oa::MediaPlayer

Synchronized playback session over independent audio and video owners. Audio output frames consumed by the device callback are the master clock. Call tick from the engine-owning thread to advance video. Decode and audio callback workers never borrow or submit through Engine. The current frame retains its decoder backing and must obey VideoFrame::mark_consumed before its storage can be recycled.

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. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
pub fn pause(&mut self) -> Result<()>
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
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. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
pub fn position_us( &self ) -> Result<u64>
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
pub fn is_playing( &self ) -> bool
No public source comment is attached to this declaration.
pub fn is_done( &self ) -> bool
No public source comment is attached to this declaration.
pub fn close(&mut self) -> Result<()>
Open both tracks paused, with the first video frame decoded. Native video output preserves its GPU backing. Opening requires a compatible Vulkan Video device and an audio output device.
pub fn open( engine: &Engine, config: MediaPlayerConfig ) -> Result<Self>
No public source comment is attached to this declaration.