pub struct ActiveIndex { /* private fields */ }Expand description
A precomputed interval index for a validated project snapshot.
Implementations§
Source§impl ActiveIndex
impl ActiveIndex
Sourcepub fn build(project: &Project) -> Result<Self, EvalError>
pub fn build(project: &Project) -> Result<Self, EvalError>
Builds an immutable interval tree from a structurally valid project.
§Errors
Returns EvalError::InvalidProject when the model is invalid.
Sourcepub fn project_id(&self) -> &ProjectId
pub fn project_id(&self) -> &ProjectId
Returns the project identity used to build this index.
Sourcepub fn effects(&self) -> impl Iterator<Item = &ClipEffect>
pub fn effects(&self) -> impl Iterator<Item = &ClipEffect>
Every effect invocation the project can draw: the steps of each composition a clip shows or draws as its source (those that compile), and each transition. A compiled composition is shared by every clip that shows it, so its steps come once however many clips show it, in index order of its first use: the walk is linear in the clips and the distinct compositions, never in their product.
Sourcepub fn peak_source_reads(
&self,
range: TimeRange,
counted: impl FnMut(&SourceId) -> bool,
) -> usize
pub fn peak_source_reads( &self, range: TimeRange, counted: impl FnMut(&SourceId) -> bool, ) -> usize
The most sequential reads of host-supplied sources that counted
selects at any one instant of range, or zero when none is read
there. A clip reads its own source while it draws it
(crate::ActiveClip::needs_source), and the source of each media
step of its compositions; crate::frame_needs asks for each of these
frames through its own decoder cursor, so this says how many cursors
decode at once.
Each compiled composition’s reads are counted once however many clips show it, so this is linear in the clips and the distinct compositions’ steps, never in their product.
Sourcepub fn source_reads(
&self,
range: TimeRange,
counted: impl FnMut(&SourceId) -> bool,
) -> Vec<SourceRead>
pub fn source_reads( &self, range: TimeRange, counted: impl FnMut(&SourceId) -> bool, ) -> Vec<SourceRead>
Every sequential read of a host-supplied source that counted
selects over range: the reader, named as crate::frame_needs
names it (the clip, and the composition step reading for it, /
before a step of its composition source), and the part of range it
may read in, the clip’s span there. The reads
Self::peak_source_reads counts, one entry each, in index order.
A reader reads only inside its span: a host can close the decoder of a reader whose span has ended, and tell which open decoder it reads last. Within its span a reader may still skip frames (a frame another reader of the same source frame asks for, or a matte no clip names).