Skip to main content

Module parallel_render

Module parallel_render 

Source
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§

ClipWithSource
A pairing of a Clip with its already-resolved (and decoded) media source.
ParallelRenderConfig
Configuration for the parallel renderer.
ParallelRenderResult
Result produced by rendering a single RenderChunk.
ParallelRenderer
Splits a timeline into frame chunks and renders them in parallel.
RenderChunk
A contiguous range of frames assigned to one render worker.
TrackRenderInput
All immutable data needed to render one track’s contribution at a single frame position.
TrackRenderOutput
The rendered output for one track at one frame position.

Enums§

TrackKind
The clip type of a track (video or audio), mirroring TrackType but limited to the subset that render_track_frame_stateless handles.

Functions§

build_track_render_inputs
Helper: build TrackRenderInputs for every renderable track of a Timeline at the given position.
render_track_frame_stateless
Render one track’s contribution at input.position without any shared mutable state.
render_tracks_parallel
Render multiple tracks concurrently using rayon.