Skip to main content

SeekPreviewSource

Trait SeekPreviewSource 

Source
pub trait SeekPreviewSource: Send + Sync {
    // Required method
    fn nearest_at(&self, frame: FrameIndex) -> Option<(FrameIndex, VideoFrame)>;
}
Expand description

Already-decoded pictures spread over a track, which a seek may answer from.

This is a trait rather than the concrete index because ExactFrameReader is portable and zvidlib::previews::PreviewIndex is not - its pass owns a thread, so it is native-only - and a reader that named the concrete type could not be built for the browser at all, which is the target that needs the tier most. An implementation must not decode and must not wait on a decoder: what it returns is a picture it already had, or nothing.

Issue #432 gave the browser its own implementation. What answers a seek on either target is now the same zvidlib::previews::PreviewStore; what differs is only what fills it, a thread in zvidlib::previews::PreviewIndex against an idle callback in zvidlib::web_previews.

Required Methods§

Source

fn nearest_at(&self, frame: FrameIndex) -> Option<(FrameIndex, VideoFrame)>

The kept picture closest to frame and the frame it is actually of, or None while nothing near that position has been decoded.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§