Skip to main content

Module editor_export

Module editor_export 

Source
Expand description

Deferred export frame generator (ED.20 / M-EDIT).

The optical printer was the lab’s export stage: it re-photographed the cut negative one frame at a time onto fresh stock, honoring every edit decision as it went. This is that printer in software — given an [EditProject], it walks the project frames 0..project_duration and, for each, maps to the source frame via [EditProject::source_time] (so trim, split, and speed are all baked in), decodes it from a seekable [EditorVideoStream], and composes it through the same EditorPreview path the live preview uses. The result is a deterministic frame stream the exporter (ED.21) feeds to the encoder, so the file you export matches the cut you scrubbed.

It is forward-only: project frames are visited in order, and our edit ops never reorder the timeline, so the source frames it requests are monotonic non-decreasing — the decode stream never re-spawns (cheap, and asserted by the golden test via ExportFrameGenerator::spawn_count).

The cinematic visual edits apply as a transform on the composed screen sprite: the zoom punch-in (ED.16) + the crop / aspect reframe (ED.15) are written into the screen sprite each frame via EditorPreview::render_framed, and the background framing (ED.18) — the backdrop fill, padding inset, and rounded-corner frame window — is applied once at construction via EditorPreview::set_background. This chunk is the frame-accurate timeline walk the whole export rests on.

Audio (ED.21) rides the same timeline: export_edited_project decodes the source’s audio once ([media::encode::decode_source_audio_f32]), retimes it in pure Rust per the segment list (retime_audio — trim + per-segment speed via linear-interpolation resample), and feeds it to the encoder’s audio scratch so the finalize remux muxes it onto the retimed video. GStreamer owns the intake; Rust owns the edit arithmetic.

Structs§

ExportFrame
One generated export frame.
ExportFrameGenerator
Walks an [EditProject] into a deterministic composed-frame stream.

Functions§

compose_project_frame
Compose project frame frame into a ComposedFrame — the single per-frame compose shared by the deferred export generator and the live editor preview (AUT-510), so what you scrub is what you ship.
cursor_for_frame 🔒
The pointer position to draw at project frame, applying CursorConfig::hide_static.
export_edited_project
Export an entire edited project to a single video file (ED.21).
retime_audio 🔒
Retime the source audio to the edited timeline (ED.21).