From 8c192cccb9d81d43ff131ea463cf3dd240e9564a Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 22:35:02 -0500 Subject: [PATCH] refactor(xfl): decode Screen Video packets through craft-video --- Cargo.lock | 18 +++++++++++++++++- Cargo.toml | 1 + crates/xfl/Cargo.toml | 4 +++- crates/xfl/src/video.rs | 40 +++------------------------------------- 4 files changed, 24 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc4b72fb..ef8b3b3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -417,6 +417,7 @@ dependencies = [ "anicraft-text", "anicraft-xml", "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18)", + "craft-video", "craft-xfl", "miniz_oxide 0.8.9", "thiserror 2.0.21", @@ -1221,7 +1222,7 @@ name = "craft-audio" version = "0.1.0" source = "git+https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18#f0f4758c01581d79577b9bf5046c06f4e77b1f18" dependencies = [ - "craft-media", + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=f0f4758c01581d79577b9bf5046c06f4e77b1f18)", "log", "symphonia", "thiserror 2.0.21", @@ -1319,6 +1320,11 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-media" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=3e0bb788a7ef48edc05285f05ee7b628c7b23bdd#3e0bb788a7ef48edc05285f05ee7b628c7b23bdd" + [[package]] name = "craft-media" version = "0.1.0" @@ -1404,6 +1410,16 @@ dependencies = [ "zip", ] +[[package]] +name = "craft-video" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=3e0bb788a7ef48edc05285f05ee7b628c7b23bdd#3e0bb788a7ef48edc05285f05ee7b628c7b23bdd" +dependencies = [ + "craft-media 0.1.0 (git+https://github.com/storytold/craft-libs?rev=3e0bb788a7ef48edc05285f05ee7b628c7b23bdd)", + "miniz_oxide 0.8.9", + "thiserror 2.0.21", +] + [[package]] name = "craft-webp" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 6b256d28..537570a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ repository = "https://github.com/storytold/AniCraft" rust-version = "1.95" [workspace.dependencies] +craft-video = { git = "https://github.com/storytold/craft-libs", rev = "3e0bb788a7ef48edc05285f05ee7b628c7b23bdd", default-features = false, features = ["screen-video"] } craft-lottie = { git = "https://github.com/storytold/craft-libs", rev = "b421e6777343cba6c017295e318624e419b95323" } anicraft-geom = { path = "crates/geom" } anicraft-doc = { path = "crates/doc" } diff --git a/crates/xfl/Cargo.toml b/crates/xfl/Cargo.toml index 77507217..2cde5ed4 100644 --- a/crates/xfl/Cargo.toml +++ b/crates/xfl/Cargo.toml @@ -8,16 +8,18 @@ publish.workspace = true repository.workspace = true [dependencies] +craft-video.workspace = true anicraft-geom.workspace = true anicraft-doc.workspace = true anicraft-xml.workspace = true # Lays imported text out with the fonts on this computer (ADR 0012, ADR 0014). anicraft-text.workspace = true craft-xfl.workspace = true -miniz_oxide = "0.8" thiserror.workspace = true [dev-dependencies] +# Synthetic Screen Video key-frame fixture compression only. +miniz_oxide = "0.8" craft-image-codecs.workspace = true [lints] diff --git a/crates/xfl/src/video.rs b/crates/xfl/src/video.rs index 3403c30d..3195fa37 100644 --- a/crates/xfl/src/video.rs +++ b/crates/xfl/src/video.rs @@ -96,43 +96,9 @@ fn flv(data: &[u8]) -> Option