pub struct DecoderPool {
backend: Backend,
videos: HashMap<String, (u64, Option<Box<dyn VideoSource>>)>,
audios: HashMap<(String, usize), (u64, Option<Box<dyn AudioSource>>)>,
tick: u64,
proxies: HashMap<String, String>,
}Expand description
Lazily opened decoders, one per (path) / (path, audio stream). Failed opens are remembered (None) so a missing file doesn’t re-spawn work every frame.
Fields§
§backend: Backend§videos: HashMap<String, (u64, Option<Box<dyn VideoSource>>)>§audios: HashMap<(String, usize), (u64, Option<Box<dyn AudioSource>>)>§tick: u64Use counter for LRU eviction: a long timeline must not accumulate one live MF reader (or ffmpeg.exe child) per distinct file forever.
proxies: HashMap<String, String>source path -> proxy file: preview decode opens the proxy instead of the original. Empty for export / one-shot pools, which must always read the real footage. Video only.
Implementations§
Source§impl DecoderPool
impl DecoderPool
pub fn new(backend: Backend) -> Self
Sourcepub fn set_proxies(&mut self, map: HashMap<String, String>)
pub fn set_proxies(&mut self, map: HashMap<String, String>)
Swap the proxy map (drops every open decoder: cached paths may now resolve differently).
pub fn set_backend(&mut self, b: Backend)
pub fn video(&mut self, path: &str) -> Option<&mut (dyn VideoSource + 'static)>
pub fn audio( &mut self, path: &str, stream: usize, ) -> Option<&mut (dyn AudioSource + 'static)>
Auto Trait Implementations§
impl Freeze for DecoderPool
impl !RefUnwindSafe for DecoderPool
impl Send for DecoderPool
impl !Sync for DecoderPool
impl Unpin for DecoderPool
impl !UnwindSafe for DecoderPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more