video: decode at the consumer's target resolution (Stage 1)

The decoder's output size was frozen to the document size at import, and export
reused that decoder — so exporting above document res upscaled the video (real
source detail discarded) and a document resize never re-targeted the decode.

Decode size is now chosen per get_frame call: VideoDecoder::get_frame and
VideoManager::get_frame take a target (w, h), capped to native (never upscale),
with the swscale context and frame caches keyed on the output size so preview
(preview res) and an in-progress export (export res) don't collide. The renderer
derives the target from the document->output base_transform, so export decodes
at export res (full detail) and the canvas at preview res. Thumbnails/asset
library pass small targets.
This commit is contained in:
Skyler Lehmkuhl
2026-06-26 00:36:35 -04:00
parent aa7d3a3bf4
commit f1fba186c1
3 changed files with 79 additions and 59 deletions
@@ -316,7 +316,8 @@ fn generate_video_thumbnail(
let frame = {
let mut video_mgr = video_manager.lock().ok()?;
video_mgr.get_frame(clip_id, timestamp)?
// Small frame for the asset thumbnail (capped to native, aspect preserved).
video_mgr.get_frame(clip_id, timestamp, THUMBNAIL_SIZE, THUMBNAIL_SIZE)?
};
let src_width = frame.width as usize;