#886: say why footage the decoders can't read shows no picture

Problem: a movie whose profile the software decoders lack (H.264 High 4:2:2 / 10-bit)
probes fine, then every frame read fails; MediaPool logged the error per frame and returned
None, so the layer rendered black with no sign why in the viewer, Project panel or for agents.

Fix: MediaPool records the reason once per file (codec from the probe plus the decoder's text
without error wrappers; I/O errors stay with missing-footage handling), logs it once, and
exposes it through the new FootageSource::problem. The Composition viewer shows it on the
affected layer, the Project panel marks the item with a warning whose tooltip is the reason,
and project.summary / footage.info carry a "problem" field. Cleared when the file is
forgotten; only set when decoding really failed, so a hardware decoder that handles the file
shows nothing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
vangel76
2026-10-11 18:49:54 +02:00
co-authored by Claude Sonnet 5.5
parent 67434e9038
commit 74b95b0a9d
9 changed files with 232 additions and 5 deletions
+29
View File
@@ -674,3 +674,32 @@ fn conformed_flac_audio_reads_back_like_the_decoder() {
assert_eq!(pool.audio_samples(&f, at, 4800, 48_000), decoded);
let _ = std::fs::remove_dir_all(&folder);
}
/// H.264 High 4:2:2 10-bit: the software decoder lacks it; the pool says why, once, and the
/// footage reports it (not a black frame without a word).
#[test]
fn an_unsupported_stream_reports_why_it_shows_no_picture() {
let Some(p) = ffmpeg_fixture(
"h264_high422_10bit.mp4",
&["-f", "lavfi", "-i", "testsrc=size=320x180:rate=24:duration=1", "-c:v", "libx264", "-profile:v", "high422", "-pix_fmt", "yuv422p10le"],
) else {
return;
};
let f = probe(&p).expect("probe");
let pool = MediaPool::new();
assert_eq!(pool.problem(&f), None, "nothing is wrong before a frame was asked for");
if pool.frame(ItemId(1), &f, Tick::ZERO).is_some() {
// a decoder that handles 4:2:2 (FilmCraft's, or a hardware one): no notice
assert_eq!(pool.problem(&f), None);
return;
}
let why = pool.problem(&f).expect("a failed frame leaves a reason");
assert!(why.contains("4:2:2"), "names the stream: {why}");
assert!(why.contains("isn't supported"), "says it is unsupported: {why}");
assert!(!why.contains("decode error"), "no error wrappers: {why}");
// it stays for the other frames, and is dropped when the file is forgotten
assert!(pool.frame(ItemId(1), &f, Tick::from_seconds_f64(0.5)).is_none());
assert_eq!(pool.problem(&f).as_deref(), Some(why.as_str()));
pool.forget(&f.path);
assert_eq!(pool.problem(&f), None);
}