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: steps of each compiled composition (once each, in order of first use) and each transition.
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
Peak number of concurrent host-source reads selected by counted in range, or 0.
Each read (a clip’s own source per crate::ActiveClip::needs_source, or a media step of
its compositions) gets its own decoder cursor in crate::frame_needs, so this is the
number of decoders active at once.
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 host-source read selected by counted over range, in index order, with readers
named as in crate::frame_needs. These are the reads Self::peak_source_reads counts.
A reader reads only inside its span, so a host can close its decoder once the span ends. Within the span it may still skip frames (deduplicated needs, unused mattes).