pub struct ActiveIndex { /* private fields */ }Expand description
A precomputed interval index for a validated project snapshot.
Implementations§
Source§impl ActiveIndex
impl ActiveIndex
Sourcepub fn sample_context<'a>(&'a self, project: &'a Project) -> SampleContext<'a>
pub fn sample_context<'a>(&'a self, project: &'a Project) -> SampleContext<'a>
The data index for sampling project’s timeline-time values; project must be the one
this index was built from.
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 plan_errors(&self, range: TimeRange) -> Vec<EvalError>
pub fn plan_errors(&self, range: TimeRange) -> Vec<EvalError>
The errors crate::evaluate would return in range because a clip shows a composition
that cannot draw, one per clip, in the order the clips start. An export checks its range
with this before its first frame instead of failing at the frame that shows the clip. When
the compositions together exceed crate::MAX_PLAN_BYTES (see Self::plans_too_large)
only the first is listed, since the cause is the whole document.
Sourcepub const fn plans_too_large(&self) -> bool
pub const fn plans_too_large(&self) -> bool
Whether the project’s compositions together exceed crate::MAX_PLAN_BYTES, so none draws.
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).