Expand description
Parallel / multi-threaded rendering for the timeline editor.
Two independent parallel rendering strategies are provided:
§Frame-chunk parallelism — ParallelRenderer
Splits the total frame range into RenderChunks and processes them
concurrently using rayon (on native targets) or sequentially (on WASM).
Best for export workflows where the entire timeline is rendered to disk.
§Per-track parallelism — render_tracks_parallel
Renders each track’s contribution at a single frame position in parallel.
Because tracks are independent (no shared writeable state), this is
embarrassingly parallel: rayon::par_iter() over TrackRenderInput
slices. Best for real-time preview where only a single composite frame
is needed at a time.
Correctness prerequisite: render_track_frame_stateless must be a pure
function — it takes all inputs by value / shared reference and returns a
self-contained TrackRenderOutput. No locks, no global mutable state.
Structs§
- Clip
With Source - A pairing of a
Clipwith its already-resolved (and decoded) media source. - Parallel
Render Config - Configuration for the parallel renderer.
- Parallel
Render Result - Result produced by rendering a single
RenderChunk. - Parallel
Renderer - Splits a timeline into frame chunks and renders them in parallel.
- Render
Chunk - A contiguous range of frames assigned to one render worker.
- Track
Render Input - All immutable data needed to render one track’s contribution at a single frame position.
- Track
Render Output - The rendered output for one track at one frame position.
Enums§
- Track
Kind - The clip type of a track (video or audio), mirroring
TrackTypebut limited to the subset thatrender_track_frame_statelesshandles.
Functions§
- build_
track_ render_ inputs - Helper: build
TrackRenderInputs for every renderable track of aTimelineat the givenposition. - render_
track_ frame_ stateless - Render one track’s contribution at
input.positionwithout any shared mutable state. - render_
tracks_ parallel - Render multiple tracks concurrently using
rayon.