#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:
co-authored by
Claude Sonnet 5.5
parent
67434e9038
commit
74b95b0a9d
@@ -441,7 +441,21 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
actions.push(("file.useProxy".into(), json!({"item": id.0})));
|
||||
}
|
||||
}
|
||||
let name_clip = Rect::from_min_max(pos2(x0 + 30.0, r.min.y), pos2(r.min.x + name_w + 4.0, r.max.y)).intersect(list);
|
||||
// Footage that can't be decoded (no decoder for its codec / profile): a warning marker
|
||||
// at the end of the name cell, the reason on hover.
|
||||
let problem = match &it.kind {
|
||||
ItemKind::Footage(f) => app.session.footage.problem(f),
|
||||
_ => None,
|
||||
};
|
||||
let name_clip =
|
||||
Rect::from_min_max(pos2(x0 + 30.0, r.min.y), pos2(r.min.x + name_w + 4.0 - if problem.is_some() { 16.0 } else { 0.0 }, r.max.y)).intersect(list);
|
||||
if let Some(why) = &problem {
|
||||
let m = Rect::from_center_size(pos2(r.min.x + name_w - 8.0, r.center().y), vec2(13.0, 12.0));
|
||||
lp.add(egui::Shape::convex_polygon(vec![m.center_top(), m.right_bottom(), m.left_bottom()], t.warning, Stroke::NONE));
|
||||
lp.text(m.center() + vec2(0.0, 1.5), Align2::CENTER_CENTER, "!", Tokens::semibold(9.0), Color32::BLACK);
|
||||
ui.interact(m.expand(2.0).intersect(list), egui::Id::new(("pproblem", id.0)), Sense::hover()).on_hover_text(why.as_str());
|
||||
app.auto.add(&format!("project.item.{}.problem", id.0), m, why);
|
||||
}
|
||||
let name_rect = Rect::from_min_max(pos2(x0 + 28.0, r.min.y + 2.0), pos2(r.min.x + name_w + 2.0, r.max.y - 2.0));
|
||||
// Inline edits (rename / comment).
|
||||
let cell_edit = |app: &mut EffectcraftApp, ui: &mut egui::Ui, actions: &mut Vec<(String, serde_json::Value)>, field: &str, cell: Rect| -> bool {
|
||||
|
||||
@@ -1045,6 +1045,30 @@ pub fn show(app: &mut EffectcraftApp, ui: &mut egui::Ui, rect: Rect) {
|
||||
app.auto.add("viewer.warpBanner", r, &text);
|
||||
}
|
||||
|
||||
// Footage that can't be decoded (no decoder for its codec / profile): say why on the layer
|
||||
// instead of leaving a black picture.
|
||||
let mut notices = 0;
|
||||
for layer in comp.layers.iter().filter(|l| l.is_active_at(time) && l.switches.video) {
|
||||
let effectcraft_engine::project::LayerSource::Footage { item } = &layer.source else { continue };
|
||||
let Some(effectcraft_engine::project::ItemKind::Footage(f)) = app.session.project.item(*item).map(|i| &i.kind) else { continue };
|
||||
let Some(why) = app.session.footage.problem(f) else { continue };
|
||||
if notices >= 3 {
|
||||
break;
|
||||
}
|
||||
let (m, _) = l2c(&ectx, layer);
|
||||
let (w, h) = effectcraft_engine::render::source_size(&app.session.project, layer);
|
||||
let c = m.apply(effectcraft_engine::geom::vec2(w as f64 / 2.0, h as f64 / 2.0));
|
||||
let at = map.to_screen([c.x, c.y]);
|
||||
let text = format!("{}: {}", layer.name, why);
|
||||
let galley = painter.layout(text.clone(), Tokens::medium(12.0), Color32::WHITE, (map.area.width() - 40.0).clamp(80.0, 420.0));
|
||||
let r = Rect::from_center_size(at + vec2(0.0, notices as f32 * 4.0), galley.size() + vec2(24.0, 16.0)).intersect(map.area);
|
||||
painter.rect_filled(r, 3.0, Color32::from_rgba_unmultiplied(0x4a, 0x1a, 0x14, 0xe6));
|
||||
painter.rect_stroke(r, 3.0, Stroke::new(1.0, t.warning), StrokeKind::Inside);
|
||||
painter.galley(pos2(r.min.x + 12.0, r.center().y - galley.size().y / 2.0), galley, Color32::WHITE);
|
||||
app.auto.add(&format!("viewer.footageProblem.{}", layer.id.0), r, &text);
|
||||
notices += 1;
|
||||
}
|
||||
|
||||
// Free transform box of a path (double-click a path with the Selection tool).
|
||||
let ft = ov::draw_free_transform(app, &ctx, &painter, &map, &paths);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user