Expand description
Real-time playback types for ff-preview.
This module exposes the primary public API for single-file video/audio
playback. All unsafe FFmpeg calls are isolated in playback_inner.
| Sub-module | Contents |
|---|---|
clock | PlaybackClock |
master_clock | Internal MasterClock |
sink | FrameSink trait, RgbaFrame, RgbaSink |
decode_buffer | DecodeBuffer, FrameResult, SeekEvent |
player | PreviewPlayer, PlayerCommand |
player_handle | PlayerHandle |
player_runner | PlayerRunner |
async_player | AsyncPreviewPlayer (tokio feature) |
playback_inner | Unsafe FFmpeg calls (SwsRgbaConverter, PCM extraction) |
Structs§
- Async
Preview Player - Async wrapper around
PlayerHandle. - Decode
Buffer - Pre-decodes frames from a video file into a ring buffer on a background thread.
- Decode
Buffer Builder - Builder for
DecodeBuffer. - Playback
Clock - A monotonic clock that tracks elapsed playback time.
- Player
Handle - Shared, cloneable handle to a running
PlayerRunner. - Player
Runner - Exclusive owner of the decode pipeline. Move to a background thread and
call
run. - Preview
Player - Thin builder for a (
PlayerRunner,PlayerHandle) pair. - Rgba
Frame - A decoded video frame as contiguous RGBA bytes.
- Rgba
Sink - Reference
FrameSinkimplementation that stores the latest frame in a sharedArc<Mutex<Option<RgbaFrame>>>.
Enums§
- Frame
Result - The result of a
DecodeBuffer::pop_framecall. - Player
Command - Commands sent from
PlayerHandletoPlayerRunnervia a bounded sync channel (capacity 64). - Seek
Event - An event emitted by
DecodeBufferafter aseek_asynccompletes.
Traits§
- Frame
Sink - A sink that receives decoded video frames as contiguous RGBA bytes.