diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 1edfca21f..f3f2e6ea6 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -49,8 +49,8 @@ jobs: # # ------------------------------------------------------------------ # # Build environment # # ------------------------------------------------------------------ -# # ocio-sys builds a stub bridge unless these are set; the oakcommon -# # ocioutils tests need the real library (see crates/oakcommon/.cargo/ +# # ocio-sys builds a stub bridge unless these are set; the oak-common +# # ocioutils tests need the real library (see crates/oak-common/.cargo/ # # config.toml, which only applies to builds run from that directory). # # ocio-sys builds its vendored OpenColorIO from source on Linux (the # # `bundled` feature; the distro package is too old for the bridge), @@ -167,17 +167,17 @@ jobs: # # machines have no system-wide OFX plugins, so the fixture is the # # only discovery. # - name: Build OFX fixture plugin -# run: crates/oakplugin/tests/fixtures/build_fixture.sh .cache/ofx-fixture +# run: crates/oak-plugin/tests/fixtures/build_fixture.sh .cache/ofx-fixture # # - name: Probe OFX plugin discovery # run: | # OFX_PLUGIN_PATH="$PWD/.cache/ofx-fixture" \ -# cargo run --locked -p oakplugin --example scan_probe > probe.log 2>&1 +# cargo run --locked -p oak-plugin --example scan_probe > probe.log 2>&1 # grep -q 'type_id=rs.oak.CiTestPlugin' probe.log # # A project carrying a plugin node must survive save/load (the # # serializer resolves plugin types via the dynamic factory). # OAK_OFX_FIXTURE_DIR="$PWD/.cache/ofx-fixtre" \ -# cargo test --locked -p oakplugin --test ofx_roundtrip +# cargo test --locked -p oak-plugin --test ofx_roundtrip windows: name: Build & test (Windows) diff --git a/Cargo.lock b/Cargo.lock index 334ac741d..3b0500ce5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4719,7 +4719,7 @@ dependencies = [ ] [[package]] -name = "oak" +name = "oak-app" version = "0.5.0" dependencies = [ "gpui", @@ -4727,79 +4727,66 @@ dependencies = [ "gpui_platform", "gpui_widgets", "image", - "oakaudio", - "oakcodec", - "oakcommon", - "oakcore-rs", - "oaknode", - "oakplugin", - "oakrender", - "oakstorage", - "oaktask", - "oaktimeline", - "oakundo", + "oak-audio", + "oak-codec", + "oak-common", + "oak-core", + "oak-node", + "oak-plugin", + "oak-render", + "oak-storage", + "oak-task", + "oak-timeline", + "oak-undo", "serde_yaml", "smallvec", ] [[package]] -name = "oak-cli" -version = "0.1.0" -dependencies = [ - "clap", - "oakcodec", - "oakcommon", - "oakcore-rs", - "oaknode", - "oakrender", - "oaktask", - "oaktimeline", -] - -[[package]] -name = "oak-worker" -version = "0.1.0" -dependencies = [ - "libc", - "oakcore-rs", - "oaknode", - "oakplugin", - "oakrender", - "serde", - "serde_json", -] - -[[package]] -name = "oakaudio" -version = "0.1.0" +name = "oak-audio" +version = "0.5.0" dependencies = [ "cpal", "ffmpeg-next", - "oakcodec", - "oakcommon", - "oakcore-rs", - "oakffmpeg-link", + "oak-codec", + "oak-common", + "oak-core", + "oak-ffmpeg-link", "thiserror 2.0.20", ] [[package]] -name = "oakcodec" -version = "0.1.0" +name = "oak-cli" +version = "0.5.0" +dependencies = [ + "clap", + "oak-codec", + "oak-common", + "oak-core", + "oak-node", + "oak-render", + "oak-task", + "oak-timeline", +] + +[[package]] +name = "oak-codec" +version = "0.5.0" dependencies = [ "ffmpeg-next", - "oakcommon", - "oakcore-rs", - "oakffmpeg-link", + "oak-common", + "oak-core", + "oak-ffmpeg-link", "thiserror 2.0.20", ] [[package]] -name = "oakcommon" -version = "0.1.0" +name = "oak-common" +version = "0.5.0" dependencies = [ "image", "log", - "oakcore-rs", + "oak-core", "ocio-rs", "quick-xml 0.41.0", "thiserror 2.0.20", @@ -4807,29 +4794,29 @@ dependencies = [ ] [[package]] -name = "oakcore-rs" -version = "0.1.0" +name = "oak-core" +version = "0.5.0" [[package]] -name = "oakffmpeg-link" -version = "0.1.0" +name = "oak-ffmpeg-link" +version = "0.5.0" [[package]] -name = "oaknode" -version = "0.1.0" +name = "oak-node" +version = "0.5.0" dependencies = [ - "oakcodec", - "oakcommon", - "oakcore-rs", - "oakundo", + "oak-codec", + "oak-common", + "oak-core", + "oak-undo", "thiserror 2.0.20", ] [[package]] -name = "oakotio" -version = "0.1.0" +name = "oak-otio" +version = "0.5.0" dependencies = [ - "oakcore-rs", + "oak-core", "quick-xml 0.41.0", "serde", "serde_json", @@ -4837,26 +4824,26 @@ dependencies = [ ] [[package]] -name = "oakplugin" -version = "0.1.0" +name = "oak-plugin" +version = "0.5.0" dependencies = [ "cc", - "oakcore-rs", - "oaknode", - "oakrender", - "oakundo", + "oak-core", + "oak-node", + "oak-render", + "oak-undo", "thiserror 2.0.20", ] [[package]] -name = "oakrender" -version = "0.1.0" +name = "oak-render" +version = "0.5.0" dependencies = [ "libc", - "oakcodec", - "oakcommon", - "oakcore-rs", - "oaknode", + "oak-codec", + "oak-common", + "oak-core", + "oak-node", "ocio-rs", "serde", "serde_json", @@ -4865,15 +4852,15 @@ dependencies = [ ] [[package]] -name = "oakstorage" -version = "0.1.0" +name = "oak-storage" +version = "0.5.0" dependencies = [ "chrono", - "oakcommon", - "oakcore-rs", - "oaknode", - "oakotio", - "oakundo", + "oak-common", + "oak-core", + "oak-node", + "oak-otio", + "oak-undo", "sea-orm", "serde", "serde_json", @@ -4882,37 +4869,50 @@ dependencies = [ ] [[package]] -name = "oaktask" -version = "0.1.0" +name = "oak-task" +version = "0.5.0" dependencies = [ - "oakcodec", - "oakcommon", - "oakcore-rs", - "oaknode", - "oakotio", - "oakrender", - "oakundo", + "oak-codec", + "oak-common", + "oak-core", + "oak-node", + "oak-otio", + "oak-render", + "oak-undo", "thiserror 2.0.20", ] [[package]] -name = "oaktimeline" -version = "0.1.0" +name = "oak-timeline" +version = "0.5.0" dependencies = [ - "oakcommon", - "oakcore-rs", - "oaknode", - "oakundo", + "oak-common", + "oak-core", + "oak-node", + "oak-undo", "thiserror 2.0.20", ] [[package]] -name = "oakundo" -version = "0.1.0" +name = "oak-undo" +version = "0.5.0" dependencies = [ "thiserror 2.0.20", ] +[[package]] +name = "oak-worker" +version = "0.5.0" +dependencies = [ + "libc", + "oak-core", + "oak-node", + "oak-plugin", + "oak-render", + "serde", + "serde_json", +] + [[package]] name = "objc" version = "0.2.7" @@ -6861,6 +6861,16 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" +[[package]] +name = "simple_player" +version = "0.1.0" +dependencies = [ + "gpui", + "gpui_platform", + "image", + "oak-app", +] + [[package]] name = "simplecss" version = "0.2.2" diff --git a/Cargo.toml b/Cargo.toml index 618049c02..bfd67f2b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,34 +14,35 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Root manifest: the `oakapp` package (the gpui-based application) plus the -# Cargo workspace over every crate under crates/. +# Root manifest: the Cargo workspace only — every package lives under +# crates/ (the GUI app in oak-app, the CLI in oak-cli, the render worker +# in oak-worker, the module rlibs in oak-*) or examples/ (standalone +# integration crates, each with its own Cargo.toml). # # gpui (the oak-gpui fork at gpui/) is excluded: it is a separate git # repository with its own workspace (resolver 3, edition 2024, # workspace.package/workspace.dependencies). Without the exclusion its -# crates would be auto-included here via oakapp's path dependencies and +# crates would be auto-included here via oak-app's path dependencies and # would inherit from THIS workspace's [workspace.package] (which lacks the # keys gpui expects). Excluded, each gpui crate resolves against gpui's own # workspace root, exactly as before the monorepo workspace existed. [workspace] -members = ["crates/*"] +members = ["crates/*", "examples/*"] exclude = ["gpui", "crates/oakengine.bk"] -# NOTE: oakstorage (crates/oakstorage) is a workspace member but NOT a -# default member (it stays out of the default-members test matrix to keep -# `cargo test` at the root fast; the app links it as a normal path -# dependency, so it builds with the app). Build/test it explicitly with -# `cargo test -p oakstorage`. +# NOTE: oak-storage is a workspace member but NOT a default member (it +# stays out of the default-members test matrix to keep `cargo test` at +# the root fast; the app links it as a normal path dependency, so it +# builds with the app). Build/test it explicitly with `cargo test -p oak-storage`. # NOTE: `crates/oakengine` (the frozen C-ABI facade cdylib) is retired: # every consumer (app/cli/worker/plugins) links the module rlibs # directly, so nothing in the workspace referenced it. The sources are # kept at crates/oakengine.bk (excluded from the workspace) as a # reference snapshot; git history is the authoritative backup. -default-members = [".", "crates/oak-cli", "crates/oak-worker"] +default-members = ["crates/oak-app", "crates/oak-cli", "crates/oak-worker"] resolver = "2" [workspace.package] -# Single source of truth for the release version: the root `oak` package +# Single source of truth for the release version: the app package # inherits it, and with it cargo-packager and the CD packaging scripts. version = "0.5.0" @@ -54,127 +55,6 @@ version = "0.5.0" # ignores). panic = "unwind" -[package] -name = "oak" -version.workspace = true -edition = "2021" -description = "Oak Video Editor" -license = "GPL-3.0-or-later" - -[lib] -name = "oakapp" -path = "src/lib.rs" -# Doctests are disabled: the app links the oak* module crates (which carry -# media/codec dependencies); the doc examples' assertions are covered by -# unit tests instead (see `oakui/timecode`). -doctest = false - -[[bin]] -name = "oak-editor" -path = "src/main.rs" - -[dependencies] -# gpui: the GPU-accelerated UI framework (oak-gpui fork, git submodule at gpui/). -gpui = { path = "gpui/crates/gpui" } -# Convenience entry point: `gpui_platform::application()` picks the platform -# backend. font-kit enables text shaping/rendering on macOS. -gpui_platform = { path = "gpui/crates/gpui_platform", features = ["font-kit"] } -# Oak's widget library: menus, viewer, form controls, project explorer. -gpui_widgets = { path = "gpui/crates/gpui_widgets" } -# The mock engine's synthetic viewer frames (`image::Frame` in a -# `RenderImage`), matching the versions gpui itself uses. -image = "0.25" -smallvec = "1" -# Editable-text widget (used by the file / export dialogs' path fields, the -# same gpui-elements crate gpui_widgets builds on). -gpui_elements = { path = "gpui/crates/gpui_elements" } -# UI string tables: YAML language packs under assets/i18n/, loaded at -# runtime (bundled with the app, user-extensible) with the compiled-in -# English table as the fallback. -serde_yaml = "0.9" - -# M14 R3: the app is a PURE module-crate consumer — every engine call is a -# direct Rust call into the oak* rlibs (oaknode for the project graph, -# oaktimeline/oakundo for the edit commands and the global undo stack, -# oakrender for the ticket arena, oakcodec for the export formats/test -# media, oaktask for the export/interchange tasks, oakaudio for the -# manager/waveforms, oakcommon/oakcore-rs for the config store and shared -# value types, oakstorage for the write-through library). No liboakengine -# dylib, no C ABI, no build.rs link step, no host shims. -oakaudio = { path = "crates/oakaudio" } -oakcodec = { path = "crates/oakcodec" } -oakcommon = { path = "crates/oakcommon" } -oakcore-rs = { path = "crates/oakcore" } -oaknode = { path = "crates/oaknode" } -oakplugin = { path = "crates/oakplugin" } -oakrender = { path = "crates/oakrender" } -oakstorage = { path = "crates/oakstorage" } -oaktask = { path = "crates/oaktask" } -oaktimeline = { path = "crates/oaktimeline" } -oakundo = { path = "crates/oakundo" } - -[features] -default = [] -# Force the mock engine even though the real facade is linked. Off by -# default: the app runs on the real engine unless `--mock` / `OAK_ENGINE=mock` -# is given at runtime (or this feature is enabled at build time). -mock-engine = [] - -[dev-dependencies] -# `#[gpui::test]` harness for engine-seam smoke tests (test-support feature). -gpui = { path = "gpui/crates/gpui", features = ["test-support"] } -# `test-support` also enables `gpui_macos/test-support`, which is what makes -# `render_to_image` (the screenshot example) available. -gpui_platform = { path = "gpui/crates/gpui_platform", features = ["test-support"] } -# Screenshot capture: `examples/screenshot.rs` saves the rendered window PNG -# (the `image` crate is already in the lockfile through gpui). -image = "0.25" - -# --------------------------------------------------------------------------- -# cargo-packager metadata (the CD workflow, .github/workflows/cd.yml, packages -# the release binaries with `cargo packager`; the schema lives at -# https://docs.crabnebula.dev/packager/configuration/). -# -# Binaries are resolved relative to `target/` (oak-editor is the -# main binary; oak-cli / oak-worker are bundled alongside). They must exist -# before packaging runs — `cargo packager` does NOT build the app itself, so -# CD builds with `cargo build --release` first. -# -# `icons/icon.png` is NOT committed: it is generated from `Oak_Icon.svg` -# (rsvg-convert) in CD right before packaging, because cargo-packager needs a -# bitmap (it converts a square PNG into .icns / .ico / hicolor PNGs itself). -# It must be 512x512: cargo-packager's tauri-icns 0.1.0 maps only 512x512@1x -# (and 1024x1024@2x) to an ICNS type — a plain 1024x1024 PNG aborts with -# "No matching IconType". -# Keep the path here in sync with the CD workflow. -# --------------------------------------------------------------------------- -[package.metadata.packager] -name = "oak" -productName = "Oak Video Editor" -identifier = "org.oakvideoeditor.Oak" -description = "Oak Video Editor" -longDescription = "Oak Video Editor: a free, open-source non-linear video editor written in Rust." -authors = ["Oak Team"] -copyright = "Copyright (C) 2026 Oak Team" -licenseFile = "LICENSE" -category = "Video" -icons = ["icons/icon.png"] -# The UI string tables (language packs); users can drop extra -# .yaml files into the installed i18n directory. -# The Windows DLL staging dir is filled by -# tooling/package/bundle-dylibs-windows.sh before `cargo packager` runs -# (NSIS/WiX place resources next to the executable, which is exactly -# where Windows resolves DLLs from). Empty locally = no bundled DLLs. -resources = [ - "assets/i18n", - { src = "target/pkg/win-dlls/*.dll", target = "." }, -] -binaries = [ - { path = "oak-editor", main = true }, - { path = "oak-cli", main = false }, - { path = "oak-worker", main = false }, -] - [profile.dev.package."*"] opt-level = 1 diff --git a/crates/oak-app/Cargo.toml b/crates/oak-app/Cargo.toml new file mode 100644 index 000000000..01ad584f2 --- /dev/null +++ b/crates/oak-app/Cargo.toml @@ -0,0 +1,140 @@ +# Oak Video Editor - Non-Linear Video Editor +# Copyright (C) 2026 Oak Team +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# The GUI application: the gpui-based `oakapp` library and the +# `oak-editor` binary. Everything under src/ is app-specific; the engine +# and module crates live in the workspace under crates/. + +[package] +name = "oak-app" +version.workspace = true +edition = "2021" +description = "Oak Video Editor" +license = "GPL-3.0-or-later" + +[lib] +name = "oakapp" +path = "src/lib.rs" +# Doctests are disabled: the app links the oak* module crates (which carry +# media/codec dependencies); the doc examples' assertions are covered by +# unit tests instead (see `oakui/timecode`). +doctest = false + +[[bin]] +name = "oak-editor" +path = "src/main.rs" + +[dependencies] +# gpui: the GPU-accelerated UI framework (oak-gpui fork, git submodule at gpui/). +gpui = { path = "../../gpui/crates/gpui" } +# Convenience entry point: `gpui_platform::application()` picks the platform +# backend. font-kit enables text shaping/rendering on macOS. +gpui_platform = { path = "../../gpui/crates/gpui_platform", features = ["font-kit"] } +# Oak's widget library: menus, viewer, form controls, project explorer. +gpui_widgets = { path = "../../gpui/crates/gpui_widgets" } +# The mock engine's synthetic viewer frames (`image::Frame` in a +# `RenderImage`), matching the versions gpui itself uses. +image = "0.25" +smallvec = "1" +# Editable-text widget (used by the file / export dialogs' path fields, the +# same gpui-elements crate gpui_widgets builds on). +gpui_elements = { path = "../../gpui/crates/gpui_elements" } +# UI string tables: YAML language packs under assets/i18n/, loaded at +# runtime (bundled with the app, user-extensible) with the compiled-in +# English table as the fallback. +serde_yaml = "0.9" + +# M14 R3: the app is a PURE module-crate consumer — every engine call is a +# direct Rust call into the oak* rlibs (oak-node for the project graph, +# oak-timeline/oak-undo for the edit commands and the global undo stack, +# oak-render for the ticket arena, oak-codec for the export formats/test +# media, oak-task for the export/interchange tasks, oak-audio for the +# manager/waveforms, oak-common/oak-core for the config store and shared +# value types, oak-storage for the write-through library). No liboakengine +# dylib, no C ABI, no build.rs link step, no host shims. +oak-audio = { path = "../oak-audio" } +oak-codec = { path = "../oak-codec" } +oak-common = { path = "../oak-common" } +oak-core = { path = "../oak-core" } +oak-node = { path = "../oak-node" } +oak-plugin = { path = "../oak-plugin" } +oak-render = { path = "../oak-render" } +oak-storage = { path = "../oak-storage" } +oak-task = { path = "../oak-task" } +oak-timeline = { path = "../oak-timeline" } +oak-undo = { path = "../oak-undo" } + +[features] +default = [] +# Force the mock engine even though the real facade is linked. Off by +# default: the app runs on the real engine unless `--mock` / `OAK_ENGINE=mock` +# is given at runtime (or this feature is enabled at build time). +mock-engine = [] + +[dev-dependencies] +# `#[gpui::test]` harness for engine-seam smoke tests (test-support feature). +gpui = { path = "../../gpui/crates/gpui", features = ["test-support"] } +# `test-support` also enables `gpui_macos/test-support`, which is what makes +# `render_to_image` (the screenshot example) available. +gpui_platform = { path = "../../gpui/crates/gpui_platform", features = ["test-support"] } +# Screenshot capture: `examples/screenshot.rs` saves the rendered window PNG +# (the `image` crate is already in the lockfile through gpui). +image = "0.25" + +# --------------------------------------------------------------------------- +# cargo-packager metadata (the CD workflow packages the release binaries +# with `cargo packager`; the schema lives at +# https://docs.crabnebula.dev/packager/configuration/). +# +# Binaries are resolved relative to `target/` (oak-editor is the +# main binary; oak-cli / oak-worker are bundled alongside). They must exist +# before packaging runs — `cargo packager` does NOT build the app itself, so +# CD builds with `cargo build --release` first. +# +# `icons/icon.png` is NOT committed: it is generated from `Oak_Icon.svg` +# (rsvg-convert) in CD right before packaging, because cargo-packager needs a +# bitmap (it converts a square PNG into .icns / .ico / hicolor PNGs itself). +# It must be 512x512: cargo-packager's tauri-icns 0.1.0 maps only 512x512@1x +# (and 1024x1024@2x) to an ICNS type — a plain 1024x1024 PNG aborts with +# "No matching IconType". +# Keep the path here in sync with the CD workflow. +# --------------------------------------------------------------------------- +[package.metadata.packager] +name = "oak" +productName = "Oak Video Editor" +identifier = "org.oakvideoeditor.Oak" +description = "Oak Video Editor" +longDescription = "Oak Video Editor: a free, open-source non-linear video editor written in Rust." +authors = ["Oak Team"] +copyright = "Copyright (C) 2026 Oak Team" +licenseFile = "LICENSE" +category = "Video" +icons = ["../../icons/icon.png"] +# The UI string tables (language packs); users can drop extra +# .yaml files into the installed i18n directory. +# The Windows DLL staging dir is filled by +# tooling/package/bundle-dylibs-windows.sh before `cargo packager` runs +# (NSIS/WiX place resources next to the executable, which is exactly +# where Windows resolves DLLs from). Empty locally = no bundled DLLs. +resources = [ + "../../assets/i18n", + { src = "../../target/pkg/win-dlls/*.dll", target = "." }, +] +binaries = [ + { path = "oak-editor", main = true }, + { path = "oak-cli", main = false }, + { path = "oak-worker", main = false }, +] diff --git a/build.rs b/crates/oak-app/build.rs similarity index 92% rename from build.rs rename to crates/oak-app/build.rs index 6aeabd549..336c9a620 100644 --- a/build.rs +++ b/crates/oak-app/build.rs @@ -39,12 +39,12 @@ fn main() { } // --- OFX interact end-to-end test plugin --------------------------------- // The app-side interact tests (src/oakui/ofx.rs) drive the *real* - // minimal test plugin (crates/oakplugin/cbits/oak_test_plugin.c) through + // minimal test plugin (../../crates/oak-plugin/cbits/oak_test_plugin.c) through // the app's interact wiring. oakplugin compiles the same C file into its // own OUT_DIR, but build-script env vars do not cross crates, so compile // it here too — the test assembles a plugin bundle from the app's // OUT_DIR. - println!("cargo:rerun-if-changed=crates/oakplugin/cbits/oak_test_plugin.c"); + println!("cargo:rerun-if-changed=../../crates/oak-plugin/cbits/oak_test_plugin.c"); build_test_plugin(&os); } @@ -63,8 +63,8 @@ fn build_test_plugin(os: &str) { }; let mut args = vec![ "-fPIC".to_string(), - "-Icrates/oakplugin/ofx".to_string(), - "crates/oakplugin/cbits/oak_test_plugin.c".to_string(), + "-I../../crates/oak-plugin/ofx".to_string(), + "../../crates/oak-plugin/cbits/oak_test_plugin.c".to_string(), link_flag.to_string(), "-o".to_string(), format!("{out}/oak_test_plugin.{ext}"), diff --git a/src/actions.rs b/crates/oak-app/src/actions.rs similarity index 99% rename from src/actions.rs rename to crates/oak-app/src/actions.rs index 7a9b245e8..39faba81a 100644 --- a/src/actions.rs +++ b/crates/oak-app/src/actions.rs @@ -463,7 +463,7 @@ pub(crate) fn shortcuts_test_lock() -> &'static Mutex<()> { /// The path of the custom-shortcuts file: `/shortcuts`, exactly like /// the C++ `MainWindow::get_custom_shortcuts_file`. pub fn custom_shortcuts_path() -> String { - let dir = oakcommon::filefunctions::FileFunctions::new() + let dir = oak_common::filefunctions::FileFunctions::new() .get_configuration_location() .unwrap_or_else(|_| std::env::temp_dir().to_string_lossy().into_owned()); format!("{}/shortcuts", dir.trim_end_matches('/')) diff --git a/src/app.rs b/crates/oak-app/src/app.rs similarity index 99% rename from src/app.rs rename to crates/oak-app/src/app.rs index 68380d0a6..a66f0194b 100644 --- a/src/app.rs +++ b/crates/oak-app/src/app.rs @@ -2339,7 +2339,7 @@ impl MenuState { loop_playback: false, show_all: false, full_screen: false, - use_proxy_media: oakcommon::configstore::ConfigStore::instance() + use_proxy_media: oak_common::configstore::ConfigStore::instance() .get_bool(None, "UseProxyMedia", 1) != 0, open_panels: WINDOW_PANELS diff --git a/src/dialogs.rs b/crates/oak-app/src/dialogs.rs similarity index 100% rename from src/dialogs.rs rename to crates/oak-app/src/dialogs.rs diff --git a/src/i18n.rs b/crates/oak-app/src/i18n.rs similarity index 100% rename from src/i18n.rs rename to crates/oak-app/src/i18n.rs diff --git a/src/lib.rs b/crates/oak-app/src/lib.rs similarity index 100% rename from src/lib.rs rename to crates/oak-app/src/lib.rs diff --git a/src/main.rs b/crates/oak-app/src/main.rs similarity index 100% rename from src/main.rs rename to crates/oak-app/src/main.rs diff --git a/src/manager.rs b/crates/oak-app/src/manager.rs similarity index 100% rename from src/manager.rs rename to crates/oak-app/src/manager.rs diff --git a/src/oakui/component/menu.rs b/crates/oak-app/src/oakui/component/menu.rs similarity index 100% rename from src/oakui/component/menu.rs rename to crates/oak-app/src/oakui/component/menu.rs diff --git a/src/oakui/component/mod.rs b/crates/oak-app/src/oakui/component/mod.rs similarity index 100% rename from src/oakui/component/mod.rs rename to crates/oak-app/src/oakui/component/mod.rs diff --git a/src/oakui/component/text_input.rs b/crates/oak-app/src/oakui/component/text_input.rs similarity index 100% rename from src/oakui/component/text_input.rs rename to crates/oak-app/src/oakui/component/text_input.rs diff --git a/src/oakui/displaycolor.rs b/crates/oak-app/src/oakui/displaycolor.rs similarity index 97% rename from src/oakui/displaycolor.rs rename to crates/oak-app/src/oakui/displaycolor.rs index 6eba3f02a..46de57556 100644 --- a/src/oakui/displaycolor.rs +++ b/crates/oak-app/src/oakui/displaycolor.rs @@ -32,8 +32,8 @@ use std::sync::{Arc, LazyLock, Mutex}; -use oakcommon::configstore::ConfigStore; -use oakrender::color::ColorProcessor; +use oak_common::configstore::ConfigStore; +use oak_render::color::ColorProcessor; /// Config key: the display color management mode ("icc" / "off"). pub const CONFIG_KEY_COLOR_MODE: &str = "DisplayColorMode"; @@ -118,7 +118,7 @@ fn current() -> Option { } // The custom override wins; empty = the platform's display profile. let icc = if icc_path.is_empty() { - oakcommon::displayicc::system_display_icc() + oak_common::displayicc::system_display_icc() } else { Some(icc_path.clone()) }; diff --git a/src/oakui/effectchain.rs b/crates/oak-app/src/oakui/effectchain.rs similarity index 92% rename from src/oakui/effectchain.rs rename to crates/oak-app/src/oakui/effectchain.rs index fa71a4581..03ca2668b 100644 --- a/src/oakui/effectchain.rs +++ b/crates/oak-app/src/oakui/effectchain.rs @@ -24,15 +24,15 @@ //! `oakengine_node_effect_remove` / `..._move` / `..._set_enabled`), rebuilt //! over the direct graph API: chain nodes are `NodeId`s in the host's own //! project, and the undoable edits are one stack entry each (a multi -//! command or a closure command from [`oakundo::undocommand::UndoCommand`]). +//! command or a closure command from [`oak_undo::undocommand::UndoCommand`]). use std::sync::{Arc, Mutex}; -use oaknode::graph::{Graph, NodeEntry}; -use oaknode::id::NodeId; -use oaknode::node::ENABLED_INPUT; -use oaknode::value::NodeValue; -use oakundo::undocommand::UndoCommand; +use oak_node::graph::{Graph, NodeEntry}; +use oak_node::id::NodeId; +use oak_node::node::ENABLED_INPUT; +use oak_node::value::NodeValue; +use oak_undo::undocommand::UndoCommand; use super::graphops::{connect_command, disconnect_command, lock, push_command as push, ProjectRef}; @@ -100,9 +100,9 @@ pub fn is_enabled(g: &Graph, node: NodeId) -> bool { /// General — the C++ `factorymenu.cpp` OpenFX branch). pub fn addable_effects() -> Vec { use super::engine::EffectEntry; - use oaknode::node::flags as node_flags; + use oak_node::node::flags as node_flags; let mut out = Vec::new(); - for meta in oaknode::factory::Factory::global().entries() { + for meta in oak_node::factory::Factory::global().entries() { // A scratch instance per entry just to read its flags (the factory // metadata carries no flag copy). let (core, _behavior) = (meta.create)(); @@ -122,7 +122,7 @@ pub fn addable_effects() -> Vec { }); } } - for meta in oaknode::factory::Factory::global().dynamic_entries() { + for meta in oak_node::factory::Factory::global().dynamic_entries() { // OpenFX plugin entries: grouped by sub-category. The factory // metadata carries no flags; plugin nodes are always video effects. let name = if meta.name.is_empty() { @@ -157,7 +157,7 @@ pub fn addable_effects() -> Vec { /// persistent-message badge and to trigger push buttons. pub fn plugin_instance_handle(g: &Graph, node: NodeId) -> Option { let behavior = g.get(node)?.behavior.as_any()?; - let plugin = behavior.downcast_ref::()?; + let plugin = behavior.downcast_ref::()?; let handle = plugin.instance_handle(); (!handle.is_null()).then_some(handle.0) } @@ -172,8 +172,8 @@ pub fn effect_params( g: &Graph, node: NodeId, ) -> Option> { - use oaknode::input::flags as input_flags; - use oaknode::value::ValueType; + use oak_node::input::flags as input_flags; + use oak_node::value::ValueType; let entry = g.get(node)?; let mut out = Vec::new(); @@ -190,7 +190,7 @@ pub fn effect_params( continue; } // The standard enabled input is structural, not a parameter. - if input.id == oaknode::node::ENABLED_INPUT { + if input.id == oak_node::node::ENABLED_INPUT { continue; } // Display name: the behavior's localized input name (C++ @@ -211,7 +211,7 @@ pub fn effect_params( for option in entry.behavior.input_combo_strings(&input.id) { properties.push(( "combo_option".to_string(), - oaknode::value::NodeValue::Text(option.to_string()), + oak_node::value::NodeValue::Text(option.to_string()), )); } } @@ -236,7 +236,7 @@ pub fn combo_options(p: &super::engine::EffectParam) -> Vec { .iter() .filter(|(k, _)| k == "combo_option") .filter_map(|(_, v)| match v { - oaknode::value::NodeValue::Text(s) => Some(s.clone()), + oak_node::value::NodeValue::Text(s) => Some(s.clone()), _ => None, }) .collect() @@ -248,7 +248,7 @@ pub fn combo_values(p: &super::engine::EffectParam) -> Vec { .iter() .filter(|(k, _)| k == "combo_value") .filter_map(|(_, v)| match v { - oaknode::value::NodeValue::Text(s) => Some(s.clone()), + oak_node::value::NodeValue::Text(s) => Some(s.clone()), _ => None, }) .collect() @@ -262,7 +262,7 @@ pub fn ui_section_of(p: &super::engine::EffectParam) -> Option<(String, String)> .iter() .find(|(k, _)| k == "ui_group") .and_then(|(_, v)| match v { - oaknode::value::NodeValue::Text(s) => Some(s.clone()), + oak_node::value::NodeValue::Text(s) => Some(s.clone()), _ => None, }); let page = p @@ -270,7 +270,7 @@ pub fn ui_section_of(p: &super::engine::EffectParam) -> Option<(String, String)> .iter() .find(|(k, _)| k == "ui_page") .and_then(|(_, v)| match v { - oaknode::value::NodeValue::Text(s) => Some(s.clone()), + oak_node::value::NodeValue::Text(s) => Some(s.clone()), _ => None, }); match (group, page) { @@ -335,14 +335,14 @@ fn add_node_command(p: &ProjectRef, entry: NodeEntry) -> (UndoCommand, AddNodeSt /// ONE undo row on success / aborts (undoing the executed children) on /// error. fn grouped(name: &str, f: impl FnOnce() -> Result) -> Result { - oakundo::global::group_begin(name).map_err(|e| e.to_string())?; + oak_undo::global::group_begin(name).map_err(|e| e.to_string())?; match f() { Ok(v) => { - oakundo::global::group_end().map_err(|e| e.to_string())?; + oak_undo::global::group_end().map_err(|e| e.to_string())?; Ok(v) } Err(e) => { - let _ = oakundo::global::group_abort(); + let _ = oak_undo::global::group_abort(); Err(e) } } @@ -461,7 +461,7 @@ pub fn insert(p: &ProjectRef, host: NodeId, index: usize, type_id: &str) -> Resu if effect_input_of(&g.graph, host).is_none() { return Err("node cannot host effects (no effect input)".to_string()); } - let Some((core, behavior)) = oaknode::factory::Factory::global().create_any(type_id) else { + let Some((core, behavior)) = oak_node::factory::Factory::global().create_any(type_id) else { return Err(format!("unknown node type id \"{type_id}\"")); }; if core.effect_input.is_empty() { @@ -680,7 +680,7 @@ mod tests { let project = graphops::create_project(); let clip = { let mut g = lock(&project); - let (core, behavior) = oaknode::block::clip_create(); + let (core, behavior) = oak_node::block::clip_create(); g.graph.add_node(core, behavior) }; (project, clip) @@ -698,7 +698,7 @@ mod tests { #[test] fn insert_walks_the_chain_and_undoes() { let _g = stack_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, host) = project_with_clip(); let ty = some_effect_type(); @@ -710,19 +710,19 @@ mod tests { assert_eq!(chain(&lock(&project).graph, host), vec![second, third, first]); // One undo row per insert. - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!(chain(&lock(&project).graph, host), vec![second, first]); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!(chain(&lock(&project).graph, host), vec![first]); - oakundo::global::redo().unwrap(); + oak_undo::global::redo().unwrap(); assert_eq!(chain(&lock(&project).graph, host), vec![second, first]); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } #[test] fn remove_bridges_the_gap() { let _g = stack_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, host) = project_with_clip(); let ty = some_effect_type(); let a = insert(&project, host, 0, &ty).unwrap(); @@ -732,15 +732,15 @@ mod tests { remove(&project, host, b).expect("remove the middle effect"); assert_eq!(chain(&lock(&project).graph, host), vec![a, c]); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!(chain(&lock(&project).graph, host), vec![a, b, c]); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } #[test] fn move_reorders_the_chain() { let _g = stack_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, host) = project_with_clip(); let ty = some_effect_type(); let a = insert(&project, host, 0, &ty).unwrap(); @@ -749,15 +749,15 @@ mod tests { move_effect(&project, host, c, 0).expect("move the last effect to the source side"); assert_eq!(chain(&lock(&project).graph, host), vec![c, a, b]); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!(chain(&lock(&project).graph, host), vec![a, b, c]); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } #[test] fn set_enabled_toggles_and_undoes() { let _g = stack_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, host) = project_with_clip(); let ty = some_effect_type(); let eff = insert(&project, host, 0, &ty).unwrap(); @@ -765,9 +765,9 @@ mod tests { set_enabled(&project, eff, false).unwrap(); assert!(!is_enabled(&lock(&project).graph, eff)); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert!(is_enabled(&lock(&project).graph, eff)); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } #[test] @@ -800,7 +800,7 @@ mod tests { #[test] fn set_input_value_undoes() { let _g = stack_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, host) = project_with_clip(); // Choose a built-in effect whose scratch core exposes a float input @@ -808,12 +808,12 @@ mod tests { let ty = addable_effects() .into_iter() .find(|entry| { - let (core, _behavior) = oaknode::factory::Factory::global() + let (core, _behavior) = oak_node::factory::Factory::global() .create_any(&entry.type_id) .expect("the entry resolves"); core.inputs.iter().any(|i| { - i.value_type == oaknode::value::ValueType::Float - && i.flags & oaknode::input::flags::HIDDEN == 0 + i.value_type == oak_node::value::ValueType::Float + && i.flags & oak_node::input::flags::HIDDEN == 0 }) }) .expect("at least one built-in effect exposes a float input") @@ -831,8 +831,8 @@ mod tests { .get(eff) .and_then(|e| { e.core.inputs.iter().find(|i| { - i.value_type == oaknode::value::ValueType::Float - && i.flags & oaknode::input::flags::HIDDEN == 0 + i.value_type == oak_node::value::ValueType::Float + && i.flags & oak_node::input::flags::HIDDEN == 0 }) }) .map(|i| i.id.clone()) @@ -849,12 +849,12 @@ mod tests { lock(&project).graph.get(eff).unwrap().core.standard_value(&input_id, -1), NodeValue::Float(42.0) ); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!( lock(&project).graph.get(eff).unwrap().core.standard_value(&input_id, -1), before ); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } /// The combo-option collector reads the repeated `("combo_option", _)` @@ -862,7 +862,7 @@ mod tests { #[test] fn combo_option_collectors_read_repeated_properties() { use crate::oakui::engine::EffectParam; - use oaknode::value::{NodeValue, ValueType}; + use oak_node::value::{NodeValue, ValueType}; let param = EffectParam { input_id: "mode".into(), display_name: "Mode".into(), @@ -885,7 +885,7 @@ mod tests { #[test] fn ui_section_collects_group_and_page() { use crate::oakui::engine::EffectParam; - use oaknode::value::{NodeValue, ValueType}; + use oak_node::value::{NodeValue, ValueType}; let plain = EffectParam { input_id: "p".into(), display_name: "P".into(), diff --git a/src/oakui/engine.rs b/crates/oak-app/src/oakui/engine.rs similarity index 97% rename from src/oakui/engine.rs rename to crates/oak-app/src/oakui/engine.rs index b0fd7614a..88d1fe0b7 100644 --- a/src/oakui/engine.rs +++ b/crates/oak-app/src/oakui/engine.rs @@ -179,20 +179,20 @@ pub struct EffectParam { /// The display name (the OFX param label). pub display_name: String, /// The value type. - pub value_type: oaknode::value::ValueType, + pub value_type: oak_node::value::ValueType, /// The current value. - pub value: oaknode::value::NodeValue, - /// The input flag bits (`oaknode::input::flags::*`). + pub value: oak_node::value::NodeValue, + /// The input flag bits (`oak_node::input::flags::*`). pub flags: u32, /// The input properties (`combo_option` / `combo_value` / `ui_group` / /// `ui_page` / `min` / `max` / ...). - pub properties: Vec<(String, oaknode::value::NodeValue)>, + pub properties: Vec<(String, oak_node::value::NodeValue)>, } /// The i18n key of a node category submenu, or `None` for categories that /// never appear in the node editor's Add menu (timeline-structural nodes). -pub fn node_category_key(category: oaknode::node::Category) -> Option<&'static str> { - use oaknode::node::Category as C; +pub fn node_category_key(category: oak_node::node::Category) -> Option<&'static str> { + use oak_node::node::Category as C; Some(match category { C::Output => "node.category.output", C::Effect => "node.category.effect", @@ -374,7 +374,7 @@ pub trait AppEngine: &mut self, _effect: EffectId, _input_id: &str, - _value: oaknode::value::NodeValue, + _value: oak_node::value::NodeValue, _cx: &mut Context, ) -> Result<(), String> { Err("effect params not supported".into()) @@ -431,12 +431,12 @@ pub trait AppEngine: /// included. fn node_library(&self) -> Vec { let mut out = Vec::new(); - let factory = oaknode::factory::Factory::global(); + let factory = oak_node::factory::Factory::global(); for meta in factory.entries() { // A scratch instance per entry just to read its flags (the // factory metadata carries no flag copy). let (core, _behavior) = (meta.create)(); - if core.flags & oaknode::node::flags::DONT_SHOW_IN_CREATE_MENU != 0 { + if core.flags & oak_node::node::flags::DONT_SHOW_IN_CREATE_MENU != 0 { continue; } let Some(category_key) = meta.categories.first().copied().and_then(node_category_key) @@ -757,7 +757,7 @@ pub trait AppEngine: /// The global "Use Proxy Media" switch (the C++ `UseProxyMedia` /// config; preview-only — exports always decode the original media). fn use_proxy_media(&self) -> bool { - oakcommon::configstore::ConfigStore::instance() + oak_common::configstore::ConfigStore::instance() .get_bool(None, "UseProxyMedia", 1) != 0 } @@ -766,7 +766,7 @@ pub trait AppEngine: /// footage's rendered frames (the C++ toggles the config and /// re-renders; the preview path reads the switch on every montage). fn set_use_proxy_media(&mut self, enabled: bool, cx: &mut Context) { - oakcommon::configstore::ConfigStore::instance().set( + oak_common::configstore::ConfigStore::instance().set( None, "UseProxyMedia", if enabled { "true" } else { "false" }, @@ -779,7 +779,7 @@ pub trait AppEngine: /// size, 2/4/8 = progressively smaller preview renders for machines /// that cannot keep up. Preview-only; exports always render native. fn playback_divider(&self) -> i64 { - oakcommon::configstore::ConfigStore::instance() + oak_common::configstore::ConfigStore::instance() .get_int(None, "PlaybackDivider", 1) .clamp(1, 8) as i64 } @@ -787,7 +787,7 @@ pub trait AppEngine: /// Sets the playback resolution divider and invalidates the rendered /// frames so the next pull re-renders at the new geometry. fn set_playback_divider(&mut self, divider: i64, cx: &mut Context) { - oakcommon::configstore::ConfigStore::instance().set( + oak_common::configstore::ConfigStore::instance().set( None, "PlaybackDivider", ÷r.clamp(1, 8).to_string(), @@ -817,7 +817,7 @@ pub trait AppEngine: } /// Starts generating the proxy of footage `id` (a background ffmpeg - /// transcode through `oaktask::ProxyTask`). Progress is reported + /// transcode through `oak_task::ProxyTask`). Progress is reported /// through [`proxy_task_progress`](Self::proxy_task_progress) and /// drained on the engine tick; completion invalidates the footage's /// rendered frames. @@ -1005,7 +1005,7 @@ pub struct MulticamState { } /// The lifecycle state of one footage's proxy (the UI mirror of -/// `oakcodec::proxymanager::ProxyState`). +/// `oak_codec::proxymanager::ProxyState`). #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ProxyMediaState { /// No proxy on disk (the menu offers "Generate"). @@ -1019,7 +1019,7 @@ pub enum ProxyMediaState { } /// The proxy generation parameters the proxy dialog edits (the app-side -/// mirror of `oakcodec::proxymanager::ProxyParams`, minus the fixed +/// mirror of `oak_codec::proxymanager::ProxyParams`, minus the fixed /// version / extension). #[derive(Debug, Clone, PartialEq)] pub struct ProxyParamsUi { @@ -1041,7 +1041,7 @@ pub struct ProxyParamsUi { /// default values): `ProxyWidth`/`ProxyHeight`/`ProxyDivider`/`ProxyCRF`/ /// `ProxyPreset`/`ProxyIncludeAudio`. pub fn proxy_params_from_config() -> ProxyParamsUi { - let codec = oakcodec::proxymanager::ProxyManager::proxy_params_from_config(); + let codec = oak_codec::proxymanager::ProxyManager::proxy_params_from_config(); let end = |a: &[u8; 32]| a.iter().position(|&b| b == 0).unwrap_or(a.len()); let preset = std::str::from_utf8(&codec.preset[..end(&codec.preset)]) .unwrap_or("") @@ -1058,8 +1058,8 @@ pub fn proxy_params_from_config() -> ProxyParamsUi { impl ProxyParamsUi { /// The codec-side params these UI params stand for. - pub fn to_codec(&self) -> oakcodec::proxymanager::ProxyParams { - let mut p = oakcodec::proxymanager::ProxyParams::default(); + pub fn to_codec(&self) -> oak_codec::proxymanager::ProxyParams { + let mut p = oak_codec::proxymanager::ProxyParams::default(); p.width = self.width; p.height = self.height; p.divider = self.divider; @@ -1072,7 +1072,7 @@ impl ProxyParamsUi { } /// UI params from codec-side params. - pub fn from_codec(codec: &oakcodec::proxymanager::ProxyParams) -> ProxyParamsUi { + pub fn from_codec(codec: &oak_codec::proxymanager::ProxyParams) -> ProxyParamsUi { let end = |a: &[u8; 32]| a.iter().position(|&b| b == 0).unwrap_or(a.len()); ProxyParamsUi { width: codec.width, diff --git a/src/oakui/frames.rs b/crates/oak-app/src/oakui/frames.rs similarity index 100% rename from src/oakui/frames.rs rename to crates/oak-app/src/oakui/frames.rs diff --git a/src/oakui/graphops.rs b/crates/oak-app/src/oakui/graphops.rs similarity index 90% rename from src/oakui/graphops.rs rename to crates/oak-app/src/oakui/graphops.rs index 3aba85eb0..86166daf9 100644 --- a/src/oakui/graphops.rs +++ b/crates/oak-app/src/oakui/graphops.rs @@ -32,18 +32,18 @@ use std::path::Path; use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::{Rational, TimeRange}; -use oaknode::block::ClipBlockBehavior; -use oaknode::footage::FootageBehavior; -use oaknode::graph::Graph; -use oaknode::id::NodeId; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; -use oaktimeline::handle::CHandle; -use oaktimeline::util::NodeRef; +use oak_core::{Rational, TimeRange}; +use oak_node::block::ClipBlockBehavior; +use oak_node::footage::FootageBehavior; +use oak_node::graph::Graph; +use oak_node::id::NodeId; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_timeline::handle::CHandle; +use oak_timeline::util::NodeRef; -use oakstorage::backend::StorageBackend; +use oak_storage::backend::StorageBackend; use super::engine::LibraryProject; @@ -116,7 +116,7 @@ pub fn footage_behavior(g: &Graph, id: NodeId) -> Option<&FootageBehavior> { pub fn is_folder(g: &Graph, id: NodeId) -> bool { g.get(id) .and_then(|e| e.behavior.as_any()) - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .is_some() } @@ -141,7 +141,7 @@ pub fn load_ove(path: &Path) -> Result { let xml = std::fs::read_to_string(path) .map_err(|e| format!("failed to read \"{}\": {e}", path.display()))?; let project = - oaknode::serializer::load(&xml).map_err(|e| format!("failed to parse: {e}"))?; + oak_node::serializer::load(&xml).map_err(|e| format!("failed to parse: {e}"))?; let abs = if path.is_absolute() { path.to_path_buf() } else { @@ -162,7 +162,7 @@ pub fn load_ove(path: &Path) -> Result { pub fn save_ove(project: &ProjectRef, path: &Path) -> Result<(), String> { let xml = { let guard = lock(project); - oaknode::serializer::save(&guard).map_err(|e| format!("failed to serialize: {e}"))? + oak_node::serializer::save(&guard).map_err(|e| format!("failed to serialize: {e}"))? }; std::fs::write(path, &xml).map_err(|e| format!("failed to write \"{}\": {e}", path.display()))?; let mut guard = lock(project); @@ -217,7 +217,7 @@ pub fn create_sequence(project: &ProjectRef, name: &str) -> NodeId { let Some(list) = find_or_create_track_list(project, seq, kind) else { continue; }; - oaktimeline::undogeneral::TimelineAddTrackCommand::new(node_ref(project, list)).redo(); + oak_timeline::undogeneral::TimelineAddTrackCommand::new(node_ref(project, list)).redo(); } seq } @@ -287,15 +287,15 @@ pub fn sequence_length(g: &Graph, seq: NodeId) -> Rational { } /// Borrow a block's core (any block kind). -fn block_core(entry: &oaknode::graph::NodeEntry) -> Option<&oaknode::block::BlockCore> { +fn block_core(entry: &oak_node::graph::NodeEntry) -> Option<&oak_node::block::BlockCore> { let any = entry.behavior.as_any()?; if let Some(c) = any.downcast_ref::() { return Some(&c.core); } - if let Some(g) = any.downcast_ref::() { + if let Some(g) = any.downcast_ref::() { return Some(&g.core); } - any.downcast_ref::() + any.downcast_ref::() .map(|t| &t.core) } @@ -560,7 +560,7 @@ pub fn import_footage(project: &ProjectRef, path: &Path) -> Result()) @@ -582,11 +582,11 @@ pub fn import_footage(project: &ProjectRef, path: &Path) -> Result Result CHandle { - oaktimeline::handle::make_owned(oaktimeline::marker::TimelineMarkerList::new()) + oak_timeline::handle::make_owned(oak_timeline::marker::TimelineMarkerList::new()) } /// Create a workarea handle (owned, refcount 1). pub fn workarea_create() -> CHandle { - oaktimeline::handle::make_owned(oaktimeline::workarea::TimelineWorkArea::new()) + oak_timeline::handle::make_owned(oak_timeline::workarea::TimelineWorkArea::new()) } /// Release an owned marker-list / workarea handle (NULL-safe; the handle @@ -629,7 +629,7 @@ pub fn markers_of(list: &CHandle) -> Vec<(Rational, String, i32)> { // SAFETY: `list` boxes a `TimelineMarkerList` (created by // `marker_list_create`); the read is shared and brief. let Some(l) = (unsafe { - oaktimeline::handle::get::>>( + oak_timeline::handle::get::>>( list, ) }) else { @@ -649,7 +649,7 @@ pub fn marker_index_at(list: &CHandle, time: Rational) -> Option { } // SAFETY: as `markers_of`. let l = unsafe { - oaktimeline::handle::get::>>( + oak_timeline::handle::get::>>( list, ) }?; @@ -665,7 +665,7 @@ pub fn workarea_state(wa: &CHandle) -> Option<(bool, TimeRange)> { // SAFETY: `wa` boxes a `TimelineWorkArea` (created by // `workarea_create`); the read is shared and brief. let w = unsafe { - oaktimeline::handle::get::>>( + oak_timeline::handle::get::>>( wa, ) }?; @@ -681,7 +681,7 @@ pub fn workarea_set(wa: &CHandle, enabled: bool, range: TimeRange) { // SAFETY: `wa` boxes a `TimelineWorkArea`; the engine writes it only // from the UI thread. if let Some(w) = unsafe { - oaktimeline::handle::get_mut::>>( + oak_timeline::handle::get_mut::>>( wa, ) } { @@ -700,19 +700,19 @@ pub fn workarea_set(wa: &CHandle, enabled: bool, range: TimeRange) { /// The configured default library as a parsed URI; an error when the /// write-through backend is disabled or the path does not resolve. -fn library() -> Result { - if !oakstorage::writethrough::storage_enabled() { +fn library() -> Result { + if !oak_storage::writethrough::storage_enabled() { return Err("the project library is not configured".to_string()); } - let uri = oakstorage::writethrough::library_uri() + let uri = oak_storage::writethrough::library_uri() .ok_or_else(|| "the project library path does not resolve".to_string())?; - oakstorage::uri::StorageUri::parse(&uri).map_err(|e| e.to_string()) + oak_storage::uri::StorageUri::parse(&uri).map_err(|e| e.to_string()) } /// The library URI selecting one row (`…?project=`). -fn project_uri(uuid: &str) -> Result { +fn project_uri(uuid: &str) -> Result { let uri = library()?; - oakstorage::uri::StorageUri::parse(&format!("{}?project={uuid}", uri.to_uri_string())) + oak_storage::uri::StorageUri::parse(&format!("{}?project={uuid}", uri.to_uri_string())) .map_err(|e| e.to_string()) } @@ -720,11 +720,11 @@ fn project_uri(uuid: &str) -> Result { /// data source). With storage disabled the result is the empty list, not /// an error (the facade contract). pub fn library_list() -> Result, String> { - if !oakstorage::writethrough::storage_enabled() { + if !oak_storage::writethrough::storage_enabled() { return Ok(Vec::new()); } let uri = library()?; - let backend = oakstorage::writethrough::backend(); + let backend = oak_storage::writethrough::backend(); let infos = backend.list_projects(&uri).map_err(|e| e.to_string())?; Ok(infos .into_iter() @@ -760,7 +760,7 @@ pub fn library_create(name: &str) -> Result { .insert("projectname".to_string(), name.to_string()); guard.uuid.clone() }; - let result = oakstorage::writethrough::backend() + let result = oak_storage::writethrough::backend() .save_project(&project, &uri, 0) .map_err(|e| e.to_string()); result?; @@ -773,7 +773,7 @@ pub fn library_delete(uuid: &str) -> Result<(), String> { if uuid.is_empty() { return Err("invalid uuid".to_string()); } - oakstorage::writethrough::backend() + oak_storage::writethrough::backend() .delete_project(&library()?, uuid) .map_err(|e| e.to_string()) } @@ -783,7 +783,7 @@ pub fn library_rename(uuid: &str, name: &str) -> Result<(), String> { if uuid.is_empty() || name.trim().is_empty() { return Err("invalid uuid or name".to_string()); } - oakstorage::writethrough::backend() + oak_storage::writethrough::backend() .rename_project(&library()?, uuid, name.trim()) .map_err(|e| e.to_string()) } @@ -795,7 +795,7 @@ pub fn library_duplicate(uuid: &str) -> Result { if uuid.is_empty() { return Err("invalid uuid".to_string()); } - let info = oakstorage::writethrough::backend() + let info = oak_storage::writethrough::backend() .duplicate_project(&library()?, uuid, None) .map_err(|e| e.to_string())?; Ok(info.uuid) @@ -804,9 +804,9 @@ pub fn library_duplicate(uuid: &str) -> Result { /// Import a `.ove` / `.otio` / `.fcpxml` project file as a new library /// row; returns the new row's uuid. pub fn library_import(path: &Path) -> Result { - let file_uri = oakstorage::uri::StorageUri::parse(&path.to_string_lossy()) + let file_uri = oak_storage::uri::StorageUri::parse(&path.to_string_lossy()) .map_err(|e| e.to_string())?; - oakstorage::writethrough::backend() + oak_storage::writethrough::backend() .import_from_file(&library()?, &file_uri) .map_err(|e| e.to_string()) } @@ -817,9 +817,9 @@ pub fn library_export(uuid: &str, path: &Path) -> Result<(), String> { if uuid.is_empty() { return Err("invalid uuid".to_string()); } - let file_uri = oakstorage::uri::StorageUri::parse(&path.to_string_lossy()) + let file_uri = oak_storage::uri::StorageUri::parse(&path.to_string_lossy()) .map_err(|e| e.to_string())?; - oakstorage::writethrough::backend() + oak_storage::writethrough::backend() .export_to_file(&library()?, uuid, &file_uri) .map_err(|e| e.to_string()) } @@ -831,7 +831,7 @@ pub fn library_open(uuid: &str) -> Result { if uuid.is_empty() { return Err("invalid uuid".to_string()); } - let result = oakstorage::writethrough::backend() + let result = oak_storage::writethrough::backend() .load(&project_uri(uuid)?) .map_err(|e| e.to_string())?; if result.project.is_null() { @@ -841,7 +841,7 @@ pub fn library_open(uuid: &str) -> Result { )); } let handle = result.project; - let project = unsafe { oakstorage::nodeutil::project_arc(&handle) } + let project = unsafe { oak_storage::nodeutil::project_arc(&handle) } .map_err(|e| e.to_string())?; lock(&project).set_modified(false); Ok(project) @@ -858,33 +858,33 @@ pub fn library_open(uuid: &str) -> Result { /// facade: an unconfigured library leaves the project unbound but the /// handle is still usable for queries. pub fn storage_bind(project: &ProjectRef) -> CHandle { - let handle = oakstorage::nodeutil::make_project_owned(project.clone()); - oakstorage::writethrough::bind_project(handle); + let handle = oak_storage::nodeutil::make_project_owned(project.clone()); + oak_storage::writethrough::bind_project(handle); handle } /// Whether the project behind `handle` is bound to the write-through /// session (the status bar's write state). pub fn storage_bound(handle: &CHandle) -> bool { - oakstorage::writethrough::is_bound(*handle) + oak_storage::writethrough::is_bound(*handle) } /// The last write-through / snapshot error of the project behind /// `handle`, if any. pub fn storage_last_error(handle: &CHandle) -> Option { - oakstorage::writethrough::last_error(*handle) + oak_storage::writethrough::last_error(*handle) } /// Flush the project's pending writes, drop its binding and release the /// query handle (the engine's project-close path). pub fn storage_unbind(handle: CHandle) { - oakstorage::writethrough::unbind_project(handle); - oakstorage::nodeutil::release_project(handle); + oak_storage::writethrough::unbind_project(handle); + oak_storage::nodeutil::release_project(handle); } /// Flush every bound project and stop the snapshot thread (app exit). pub fn storage_flush() { - oakstorage::writethrough::flush_all(); + oak_storage::writethrough::flush_all(); } // --------------------------------------------------------------------------- @@ -892,25 +892,25 @@ pub fn storage_flush() { // // The timeline edits the facade's `oakengine_sequence_*` / `oakengine_clip_*` // exports performed, rebuilt over the oaktimeline command structs and the -// oakundo global stack's safe [`oakundo::global::push`]. Every entry point +// oakundo global stack's safe [`oak_undo::global::push`]. Every entry point // pushes exactly one undo row (composite edits assemble a multi command). // --------------------------------------------------------------------------- /// Push one command onto the global undo stack (redo then record). -pub fn push_command(cmd: oakundo::undocommand::UndoCommand, name: &str) -> Result<(), String> { - oakundo::global::push(cmd, name).map_err(|e| e.to_string()) +pub fn push_command(cmd: oak_undo::undocommand::UndoCommand, name: &str) -> Result<(), String> { + oak_undo::global::push(cmd, name).map_err(|e| e.to_string()) } /// Assemble `children` into ONE multi command and push it (an empty set /// is a no-op, mirroring the stack's empty-multi discard). pub fn push_multi_command( - children: Vec, + children: Vec, name: &str, ) -> Result<(), String> { if children.is_empty() { return Ok(()); } - let mut multi = oakundo::undocommand::UndoCommand::multi(); + let mut multi = oak_undo::undocommand::UndoCommand::multi(); for child in children { multi.multi_add_child(child); } @@ -918,12 +918,12 @@ pub fn push_multi_command( } /// Push one command (private alias). -fn push(cmd: oakundo::undocommand::UndoCommand, name: &str) -> Result<(), String> { +fn push(cmd: oak_undo::undocommand::UndoCommand, name: &str) -> Result<(), String> { push_command(cmd, name) } /// Assemble and push a multi command (private alias). -fn push_multi(children: Vec, name: &str) -> Result<(), String> { +fn push_multi(children: Vec, name: &str) -> Result<(), String> { push_multi_command(children, name) } @@ -935,7 +935,7 @@ pub fn connect_command( from: NodeId, to: NodeId, input_id: &str, -) -> Result { +) -> Result { { let g = lock(p); if !g.graph.is_valid(from) || !g.graph.is_valid(to) { @@ -955,7 +955,7 @@ pub fn connect_command( } let (p1, p2) = (p.clone(), p.clone()); let (id1, id2) = (input_id.to_string(), input_id.to_string()); - Ok(oakundo::undocommand::UndoCommand::from_closures( + Ok(oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); let _ = g.graph.connect(from, to, &id1, -1); @@ -977,7 +977,7 @@ pub fn disconnect_command( p: &ProjectRef, to: NodeId, input_id: &str, -) -> Result { +) -> Result { let source = { let g = lock(p); let has_input = g @@ -992,7 +992,7 @@ pub fn disconnect_command( }; let (p1, p2) = (p.clone(), p.clone()); let (id1, id2) = (input_id.to_string(), input_id.to_string()); - Ok(oakundo::undocommand::UndoCommand::from_closures( + Ok(oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); g.graph.disconnect_input(to, &id1, -1); @@ -1016,7 +1016,7 @@ pub fn set_context_position_command( context: NodeId, x: f64, y: f64, -) -> Result { +) -> Result { let old = { let g = lock(p); if !g.graph.is_valid(node) || !g.graph.is_valid(context) { @@ -1033,7 +1033,7 @@ pub fn set_context_position_command( }) }; let (p1, p2) = (p.clone(), p.clone()); - Ok(oakundo::undocommand::UndoCommand::from_closures( + Ok(oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); if let Some(e) = g.graph.get_mut(node) { @@ -1068,7 +1068,7 @@ pub fn add_track(p: &ProjectRef, seq: NodeId, kind: TrackType) -> Result Result Result<(), String> { push( - oaktimeline::undogeneral::TimelineRemoveTrackCommand::new(node_ref(p, track)).to_command(), + oak_timeline::undogeneral::TimelineRemoveTrackCommand::new(node_ref(p, track)).to_command(), "Remove Track", ) } @@ -1134,7 +1134,7 @@ fn set_track_flag( } let (p1, p2) = (p.clone(), p.clone()); push( - oakundo::undocommand::UndoCommand::from_closures( + oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); if let Some(t) = g @@ -1265,7 +1265,7 @@ pub fn place_footage_clip( // `oaknode_clip_set_media_in` + `oaknode_block_set_length_and_media_in`). let clip = { let mut g = lock(p); - let (core, behavior) = oaknode::block::clip_create(); + let (core, behavior) = oak_node::block::clip_create(); let id = g.graph.add_node(core, behavior); if let Some(c) = g .graph @@ -1279,14 +1279,14 @@ pub fn place_footage_clip( id }; - let place = oaktimeline::undopointer::TrackPlaceBlockCommand::new( + let place = oak_timeline::undopointer::TrackPlaceBlockCommand::new( node_ref(p, list), track_index as i32, node_ref(p, clip), in_r, ) .to_command(); - let edge = connect_command(p, footage, clip, oaknode::block::clip_input::TEXTURE_INPUT)?; + let edge = connect_command(p, footage, clip, oak_node::block::clip_input::TEXTURE_INPUT)?; push_multi(vec![place, edge], "Add Clip")?; Ok(clip) } @@ -1328,7 +1328,7 @@ pub fn place_footage_clips_linked( let mut clips = Vec::with_capacity(placements.len()); for _ in placements { let mut g = lock(p); - let (core, behavior) = oaknode::block::clip_create(); + let (core, behavior) = oak_node::block::clip_create(); let id = g.graph.add_node(core, behavior); if let Some(c) = g .graph @@ -1350,7 +1350,7 @@ pub fn place_footage_clips_linked( .ok_or_else(|| "sequence has no track list for this type".to_string())? }; commands.push( - oaktimeline::undopointer::TrackPlaceBlockCommand::new( + oak_timeline::undopointer::TrackPlaceBlockCommand::new( node_ref(p, list), track_index as i32, node_ref(p, clip), @@ -1358,7 +1358,7 @@ pub fn place_footage_clips_linked( ) .to_command(), ); - commands.push(connect_command(p, footage, clip, oaknode::block::clip_input::TEXTURE_INPUT)?); + commands.push(connect_command(p, footage, clip, oak_node::block::clip_input::TEXTURE_INPUT)?); } // Link the group both ways (closure commands capture the current // links for undo). @@ -1372,7 +1372,7 @@ pub fn place_footage_clips_linked( g.graph.links_of(a) }; let (p1, p2) = (p.clone(), p.clone()); - commands.push(oakundo::undocommand::UndoCommand::from_closures( + commands.push(oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); if let Some(entry) = g.graph.get_mut(a) { @@ -1416,7 +1416,7 @@ pub fn split_clip(p: &ProjectRef, clip: NodeId, time_ts: i64) -> Result<(), Stri return Err(format!("split time {time_ts} is not strictly inside the clip")); } push( - oaktimeline::undosplit::BlockSplitCommand::new(node_ref(p, clip), point).to_command(), + oak_timeline::undosplit::BlockSplitCommand::new(node_ref(p, clip), point).to_command(), "Split Clip", ) } @@ -1427,7 +1427,7 @@ pub fn split_clip(p: &ProjectRef, clip: NodeId, time_ts: i64) -> Result<(), Stri /// module's own `BlockTrimCommand` applies its length setters with /// inverted semantics, so the closures carry the correct mapping). pub fn trim_clip(p: &ProjectRef, clip: NodeId, new_in_ts: i64, new_out_ts: i64) -> Result<(), String> { - use oaknode::block::BlockCore; + use oak_node::block::BlockCore; if new_in_ts < 0 || new_out_ts <= new_in_ts { return Err("invalid trim range (need 0 <= new_in < new_out)".to_string()); } @@ -1459,9 +1459,9 @@ pub fn trim_clip(p: &ProjectRef, clip: NodeId, new_in_ts: i64, new_out_ts: i64) out_anchored: bool, old: Rational, new: Rational, - ) -> oakundo::undocommand::UndoCommand { + ) -> oak_undo::undocommand::UndoCommand { let (p1, p2) = (p.clone(), p.clone()); - oakundo::undocommand::UndoCommand::from_closures( + oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); if let Some(c) = g @@ -1517,7 +1517,7 @@ fn move_clip_command( p: &ProjectRef, clip: NodeId, new_in_ts: i64, -) -> Result { +) -> Result { let (tb, list, track_index) = { let g = lock(p); let track = clip_track(&g.graph, clip).ok_or_else(|| "the clip is not on a track".to_string())?; @@ -1531,7 +1531,7 @@ fn move_clip_command( .ok_or_else(|| "the sequence has no valid frame rate".to_string())?; (tb, list, track_index) }; - Ok(oaktimeline::undopointer::TrackMoveBlockCommand::new( + Ok(oak_timeline::undopointer::TrackMoveBlockCommand::new( node_ref(p, list), track_index, node_ref(p, clip), @@ -1557,7 +1557,7 @@ fn move_clip_to_track_commands( clip: NodeId, dest_track: NodeId, new_in_ts: i64, -) -> Result, String> { +) -> Result, String> { let (tb, list, dest_index, source_track) = { let g = lock(p); let source_track = @@ -1576,7 +1576,7 @@ fn move_clip_to_track_commands( }; let in_r = ts_to_rational(new_in_ts, tb); - let gap = oaktimeline::undogeneral::TrackReplaceBlockWithGapCommand::new( + let gap = oak_timeline::undogeneral::TrackReplaceBlockWithGapCommand::new( node_ref(p, source_track), node_ref(p, clip), true, @@ -1592,7 +1592,7 @@ fn move_clip_to_track_commands( .ok_or_else(|| "the node is not a clip".to_string())? }; let (p1, p2) = (p.clone(), p.clone()); - let rehome = oakundo::undocommand::UndoCommand::from_closures( + let rehome = oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); if let Some(c) = g @@ -1616,7 +1616,7 @@ fn move_clip_to_track_commands( } }, ); - let place = oaktimeline::undopointer::TrackPlaceBlockCommand::new( + let place = oak_timeline::undopointer::TrackPlaceBlockCommand::new( node_ref(p, list), dest_index, node_ref(p, clip), @@ -1720,13 +1720,13 @@ pub fn delete_clip(p: &ProjectRef, clip: NodeId) -> Result<(), String> { let g = lock(p); clip_track(&g.graph, clip).ok_or_else(|| "the clip is not on a track".to_string())? }; - let gap = oaktimeline::undogeneral::TrackReplaceBlockWithGapCommand::new( + let gap = oak_timeline::undogeneral::TrackReplaceBlockWithGapCommand::new( node_ref(p, source_track), node_ref(p, clip), true, ) .to_command(); - let remove = oaktask::nodeops::remove_node_command(p.clone(), clip); + let remove = oak_task::nodeops::remove_node_command(p.clone(), clip); push_multi(vec![gap, remove], "Delete Clips") } @@ -1743,7 +1743,7 @@ pub fn ripple_delete_clip(p: &ProjectRef, clip: NodeId) -> Result<(), String> { (track, TimeRange::new(in_r, out_r)) }; push( - oaktimeline::undoripple::TrackRippleRemoveAreaCommand::new(node_ref(p, track), range) + oak_timeline::undoripple::TrackRippleRemoveAreaCommand::new(node_ref(p, track), range) .to_command(), "Ripple Delete Clip", ) @@ -1757,7 +1757,7 @@ pub fn marker_add(markers: &CHandle, time: Rational, name: &str, color: i32) -> return Err("a marker already exists at that time".to_string()); } push( - oaktimeline::marker::MarkerAddCommand::new( + oak_timeline::marker::MarkerAddCommand::new( *markers, TimeRange::new(time, time), name, @@ -1775,7 +1775,7 @@ pub fn marker_remove(markers: &CHandle, time: Rational) -> Result<(), String> { return Err("no marker at that time".to_string()); }; push( - oaktimeline::marker::MarkerRemoveCommand::new(*markers, index).to_command(), + oak_timeline::marker::MarkerRemoveCommand::new(*markers, index).to_command(), "Remove Marker", ) } @@ -1793,8 +1793,8 @@ pub fn workarea_set_undoable( ) -> Result<(), String> { push_multi( vec![ - oaktimeline::workarea::WorkareaSetEnabledCommand::new(*wa, enabled).to_command(), - oaktimeline::workarea::WorkareaSetRangeCommand::new_with_old(*wa, range, old_range) + oak_timeline::workarea::WorkareaSetEnabledCommand::new(*wa, enabled).to_command(), + oak_timeline::workarea::WorkareaSetRangeCommand::new_with_old(*wa, range, old_range) .to_command(), ], "Set Workarea", @@ -1807,7 +1807,7 @@ pub fn workarea_set_undoable( /// removed. pub fn remove_node(p: &ProjectRef, node: NodeId) -> Result<(), String> { push( - oaktimeline::undocommon::create_remove_command(&node_ref(p, node)), + oak_timeline::undocommon::create_remove_command(&node_ref(p, node)), "Remove Node", ) } @@ -1954,7 +1954,7 @@ pub fn paste_clips( let clip = { let mut g = lock(p); - let (core, behavior) = oaknode::block::clip_create(); + let (core, behavior) = oak_node::block::clip_create(); let id = g.graph.add_node(core, behavior); if let Some(c) = g .graph @@ -1970,7 +1970,7 @@ pub fn paste_clips( }; new_ids.push(clip); commands.push( - oaktimeline::undopointer::TrackPlaceBlockCommand::new( + oak_timeline::undopointer::TrackPlaceBlockCommand::new( node_ref(p, list), track_index as i32, node_ref(p, clip), @@ -1982,7 +1982,7 @@ pub fn paste_clips( p, item.footage, clip, - oaknode::block::clip_input::TEXTURE_INPUT, + oak_node::block::clip_input::TEXTURE_INPUT, )?); } // Link the pasted group both ways (the C++ pastes linked selections as @@ -1991,7 +1991,7 @@ pub fn paste_clips( let first = new_ids[0]; for &other in &new_ids[1..] { let (p1, p2) = (p.clone(), p.clone()); - commands.push(oakundo::undocommand::UndoCommand::from_closures( + commands.push(oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = lock(&p1); for (a, b) in [(first, other), (other, first)] { @@ -2057,7 +2057,7 @@ mod tests { #[test] fn track_flag_setters_toggle_and_undo() { let _g = test_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, _seq, track) = project_with_track(TrackType::Video); assert_eq!(track_muted(&project, track), Some(false)); @@ -2068,27 +2068,27 @@ mod tests { set_track_locked(&project, track, true).expect("lock the track"); assert_eq!(track_locked(&project, track), Some(true)); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!(track_locked(&project, track), Some(false)); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!(track_muted(&project, track), Some(false)); - oakundo::global::redo().unwrap(); + oak_undo::global::redo().unwrap(); assert_eq!(track_muted(&project, track), Some(true)); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } /// Setting a flag to its current value pushes no undo row. #[test] fn track_flag_setter_noop_when_unchanged() { let _g = test_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, _seq, track) = project_with_track(TrackType::Audio); - let before = oakundo::global::count().unwrap(); + let before = oak_undo::global::count().unwrap(); set_track_muted(&project, track, false).expect("mute already false"); set_track_locked(&project, track, false).expect("lock already false"); - assert_eq!(oakundo::global::count().unwrap(), before); - oakundo::global::clear().unwrap(); + assert_eq!(oak_undo::global::count().unwrap(), before); + oak_undo::global::clear().unwrap(); } /// Undo/redo stability: undo → redo → undo → redo must converge to the @@ -2098,11 +2098,11 @@ mod tests { #[test] fn undo_redo_cycles_converge_to_the_same_state() { let _g = test_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let project = create_project(); let seq = create_sequence(&project, "Undo Cycles"); let media = std::env::temp_dir().join(format!("oak_undo_cycle_{}.mp4", std::process::id())); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); let footage = import_footage(&project, &media).expect("import"); place_footage_clips_linked( &project, @@ -2133,7 +2133,7 @@ mod tests { // Two full undo/redo cycles; the state must be identical after // every redo and match the pre-undo state after every undo. for cycle in 0..2 { - oakundo::global::undo().expect("undo"); + oak_undo::global::undo().expect("undo"); let g = lock(&project); let video_blocks: usize = track_ids(&g.graph, seq, TrackType::Video) .iter() @@ -2141,11 +2141,11 @@ mod tests { .sum(); assert_eq!(video_blocks, 0, "cycle {cycle}: undo removes the clips"); drop(g); - oakundo::global::redo().expect("redo"); + oak_undo::global::redo().expect("redo"); let state = snapshot(&project); assert_eq!(state, before, "cycle {cycle}: redo must restore the exact state"); } - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -2153,11 +2153,11 @@ mod tests { #[test] fn track_flag_setters_reject_non_tracks() { let _g = test_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, seq, _track) = project_with_track(TrackType::Video); assert!(set_track_muted(&project, seq, true).is_err()); assert!(set_track_locked(&project, seq, true).is_err()); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } } @@ -2171,7 +2171,7 @@ mod undo_cycle_track_tests { #[test] fn add_track_undo_redo_cycles_converge() { let _g = test_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let project = create_project(); let seq = create_sequence(&project, "Add Track Cycles"); let count_of = |p: &ProjectRef, kind: TrackType| { @@ -2188,13 +2188,13 @@ mod undo_cycle_track_tests { }; for cycle in 0..3 { - oakundo::global::undo().expect("undo"); + oak_undo::global::undo().expect("undo"); assert_eq!( count_of(&project, TrackType::Video), 2, "cycle {cycle}: undo removes only the added track" ); - oakundo::global::redo().expect("redo"); + oak_undo::global::redo().expect("redo"); assert_eq!( count_of(&project, TrackType::Video), 3, @@ -2212,7 +2212,7 @@ mod undo_cycle_track_tests { ); drop(g); } - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } } @@ -2250,8 +2250,8 @@ mod undo_cycle_ops_tests { fn cycle_assert(p: &ProjectRef, seq: NodeId, post: &(usize, Vec<(NodeId, Vec<(NodeId, i128, i128)>)>), what: &str) { for cycle in 0..3 { - oakundo::global::undo().unwrap_or_else(|e| panic!("{what}: undo failed: {e:?}")); - oakundo::global::redo().unwrap_or_else(|e| panic!("{what}: redo failed: {e:?}")); + oak_undo::global::undo().unwrap_or_else(|e| panic!("{what}: undo failed: {e:?}")); + oak_undo::global::redo().unwrap_or_else(|e| panic!("{what}: redo failed: {e:?}")); let state = snapshot(p, seq); assert_eq!(&state, post, "{what}: cycle {cycle} diverged"); } @@ -2281,9 +2281,9 @@ mod undo_cycle_ops_tests { #[test] fn move_trim_delete_split_cycles_converge() { let _g = test_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let media = std::env::temp_dir().join(format!("oak_cycle_ops_{}.mp4", std::process::id())); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate"); + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate"); // --- move --- let (project, seq, _footage) = project_with_two_clips(&media); @@ -2297,25 +2297,25 @@ mod undo_cycle_ops_tests { move_clip(&project, clip, 20).expect("move"); let post = snapshot(&project, seq); cycle_assert(&project, seq, &post, "move"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); // --- trim --- trim_clip(&project, clip, 22, 28).expect("trim"); let post = snapshot(&project, seq); cycle_assert(&project, seq, &post, "trim"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); // --- split --- split_clip(&project, clip, 25).expect("split"); let post = snapshot(&project, seq); cycle_assert(&project, seq, &post, "split"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); // --- delete --- delete_clip(&project, clip).expect("delete"); let post = snapshot(&project, seq); cycle_assert(&project, seq, &post, "delete"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); // --- ripple delete (on a fresh project, then check) --- let (project, seq, _footage) = project_with_two_clips(&media); @@ -2329,7 +2329,7 @@ mod undo_cycle_ops_tests { ripple_delete_clip(&project, clip).expect("ripple delete"); let post = snapshot(&project, seq); cycle_assert(&project, seq, &post, "ripple delete"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } diff --git a/src/oakui/icons.rs b/crates/oak-app/src/oakui/icons.rs similarity index 98% rename from src/oakui/icons.rs rename to crates/oak-app/src/oakui/icons.rs index ac3aa09b1..40f1dd984 100644 --- a/src/oakui/icons.rs +++ b/crates/oak-app/src/oakui/icons.rs @@ -59,7 +59,7 @@ pub fn icon_path(name: &str, cx: &App) -> PathBuf { "light" }; PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("assets/icons") + .join("../../assets/icons") .join(family) .join(format!("{name}.png")) } @@ -103,7 +103,7 @@ mod tests { ] { for family in ["dark", "light"] { let path = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("assets/icons") + .join("../../assets/icons") .join(family) .join(format!("{name}.png")); assert!( diff --git a/src/oakui/mock.rs b/crates/oak-app/src/oakui/mock.rs similarity index 98% rename from src/oakui/mock.rs rename to crates/oak-app/src/oakui/mock.rs index c37a84fc1..881886f81 100644 --- a/src/oakui/mock.rs +++ b/crates/oak-app/src/oakui/mock.rs @@ -61,10 +61,10 @@ use gpui_widgets::audio_meter::AudioMeterDataSource; use gpui_widgets::project_explorer::{ProjectDataSource, ProjectEntry}; use gpui_widgets::viewer::PlaybackClock; -use oakcore_rs::Rational; -use oaknode::block::clip_input; -use oaknode::track::TrackType; -use oaktimeline::util::{block_clip_create, track_append_block}; +use oak_core::Rational; +use oak_node::block::clip_input; +use oak_node::track::TrackType; +use oak_timeline::util::{block_clip_create, track_append_block}; use super::engine::{ AppEngine, EngineGateway, ExportEvent, ExportSession, LibraryProject, Monitor, MulticamState, @@ -543,7 +543,7 @@ pub struct MockEngine { /// sequence's video tracks are the angles. Created lazily so the demo /// panel shows a genuine graph behind its synthetic frames — and the /// switch / enable / disable commands run on the real command path - /// (`oaktimeline::multicam` + the global undo stack). + /// (`oak_timeline::multicam` + the global undo stack). multicam_graph: Mutex>, /// The demo multicam angle-frame cache: source → (playhead, image), so /// a paused cell never regenerates its picture. @@ -2079,20 +2079,20 @@ impl AppEngine for MockEngine { return; // The demo starts enabled; enabling again is a no-op. } let sequence = demo.sequence.clone(); - let cmd = oaktimeline::multicam::multicam_enable(vec![clip], sequence); - let label = oaktimeline::multicam::enable_label(1); + let cmd = oak_timeline::multicam::multicam_enable(vec![clip], sequence); + let label = oak_timeline::multicam::enable_label(1); if let Err(e) = super::graphops::push_command(cmd, &label) { println!("[mock] multicam enable failed: {e}"); } } else { - let cmd = oaktimeline::multicam::multicam_disable(vec![clip]); - let label = oaktimeline::multicam::disable_label(1); + let cmd = oak_timeline::multicam::multicam_disable(vec![clip]); + let label = oak_timeline::multicam::disable_label(1); if let Err(e) = super::graphops::push_command(cmd, &label) { println!("[mock] multicam disable failed: {e}"); } } // Re-resolve the multicam node after the command. - demo.multicam = oaktimeline::multicam::clip_find_multicam(&demo.clip); + demo.multicam = oak_timeline::multicam::clip_find_multicam(&demo.clip); self.multicam_frames.lock().unwrap().clear(); cx.notify(); } @@ -2111,14 +2111,14 @@ impl AppEngine for MockEngine { } let playhead_frame = self.clock_frame(Monitor::Program, cx).0; let playhead = Rational::new(playhead_frame.max(0), 25); - let cmd = oaktimeline::multicam::multicam_switch( + let cmd = oak_timeline::multicam::multicam_switch( demo.clip.clone(), source, split_clip, playhead, ); if let Err(e) = - super::graphops::push_command(cmd, oaktimeline::multicam::SWITCH_LABEL) + super::graphops::push_command(cmd, oak_timeline::multicam::SWITCH_LABEL) { println!("[mock] multicam switch failed: {e}"); } @@ -2268,17 +2268,17 @@ impl AudioMeterDataSource for MockEngine { /// The mock's demo multicam: a real oaknode graph whose source sequence's /// video tracks are the angles. The panel's frames are synthetic colored /// cells, but the switch / enable / disable commands run on the REAL command -/// path (`oaktimeline::multicam` + the global undo stack), so the demo +/// path (`oak_timeline::multicam` + the global undo stack), so the demo /// exercises the same machinery the real engine uses. struct DemoMulticamGraph { /// The project holding the graph. project: graphops::ProjectRef, /// The clip whose texture input the multicam feeds. - clip: oaktimeline::util::NodeRef, + clip: oak_timeline::util::NodeRef, /// The source sequence (its video tracks are the angles). - sequence: oaktimeline::util::NodeRef, + sequence: oak_timeline::util::NodeRef, /// The multicam node (present while enabled). - multicam: Option, + multicam: Option, } impl DemoMulticamGraph { @@ -2287,9 +2287,9 @@ impl DemoMulticamGraph { /// tracks are built directly in the graph (no `Add Track` undo entries — /// the demo's initial state is not a user edit). fn build() -> Self { - use oaknode::node::NodeCore; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior}; + use oak_node::node::NodeCore; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior}; let project = graphops::create_project(); let sequence = graphops::create_sequence(&project, "Multicam Demo"); @@ -2353,16 +2353,16 @@ impl DemoMulticamGraph { .behavior .as_any_mut() .unwrap() - .downcast_mut::() + .downcast_mut::() .unwrap(); - c.core.range = oakcore_rs::TimeRange::new(Rational::new(0, 1), Rational::new(200, 1)); + c.core.range = oak_core::TimeRange::new(Rational::new(0, 1), Rational::new(200, 1)); c.core.media_in = Rational::new(0, 1); } let track0 = { let g = graphops::lock(&project); graphops::track_ids(&g.graph, sequence, TrackType::Video)[0] }; - let track0 = oaktimeline::util::NodeRef::new(project.clone(), track0); + let track0 = oak_timeline::util::NodeRef::new(project.clone(), track0); track_append_block(&track0, &clip); { let mut g = graphops::lock(&project); @@ -2372,13 +2372,13 @@ impl DemoMulticamGraph { } // Enable multicam through the real command (kept out of the undo // stack — it is the demo's initial state, not a user edit). - let mut enable = oaktimeline::multicam::MultiCamEnableCommand::new( + let mut enable = oak_timeline::multicam::MultiCamEnableCommand::new( vec![clip.clone()], - oaktimeline::util::NodeRef::new(project.clone(), sequence), + oak_timeline::util::NodeRef::new(project.clone(), sequence), ); enable.redo(); - let multicam = oaktimeline::multicam::clip_find_multicam(&clip); - let sequence = oaktimeline::util::NodeRef::new(project.clone(), sequence); + let multicam = oak_timeline::multicam::clip_find_multicam(&clip); + let sequence = oak_timeline::util::NodeRef::new(project.clone(), sequence); DemoMulticamGraph { project, clip, diff --git a/src/oakui/mod.rs b/crates/oak-app/src/oakui/mod.rs similarity index 100% rename from src/oakui/mod.rs rename to crates/oak-app/src/oakui/mod.rs diff --git a/src/oakui/multicam.rs b/crates/oak-app/src/oakui/multicam.rs similarity index 90% rename from src/oakui/multicam.rs rename to crates/oak-app/src/oakui/multicam.rs index 42be3938b..02054bd95 100644 --- a/src/oakui/multicam.rs +++ b/crates/oak-app/src/oakui/multicam.rs @@ -15,7 +15,7 @@ // along with this program. If not, see . //! App-side multicam resolution: the bridge between the -//! [`oaktimeline::multicam`](oaktimeline::multicam) commands and the +//! [`oak_timeline::multicam`](oak_timeline::multicam) commands and the //! UI's detection / menu needs. //! //! The C++ `MulticamWidget` detects a multicam by asking the viewer, then @@ -32,13 +32,13 @@ //! clip under the playhead on the video tracks), used when nothing is //! selected. -use oakcore_rs::Rational; -use oaknode::block::clip_input; -use oaknode::graph::Graph; -use oaknode::id::NodeId; -use oaknode::nodes::multicamnode::{SEQUENCE_INPUT, SEQUENCE_TYPE_INPUT}; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::TrackType; +use oak_core::Rational; +use oak_node::block::clip_input; +use oak_node::graph::Graph; +use oak_node::id::NodeId; +use oak_node::nodes::multicamnode::{SEQUENCE_INPUT, SEQUENCE_TYPE_INPUT}; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::TrackType; use super::engine::MulticamState; use super::graphops::{self, lock, ProjectRef}; @@ -144,7 +144,7 @@ pub fn multicam_current_source(p: &ProjectRef, mc: NodeId) -> i32 { let g = lock(p); g.graph .get(mc) - .map(|e| e.core.standard_value(oaknode::nodes::multicamnode::CURRENT_INPUT, -1).to_double() as i32) + .map(|e| e.core.standard_value(oak_node::nodes::multicamnode::CURRENT_INPUT, -1).to_double() as i32) .unwrap_or(-1) } @@ -153,8 +153,8 @@ pub fn multicam_current_source(p: &ProjectRef, mc: NodeId) -> i32 { /// source. `None` when the clip has no multicam or the multicam has no /// connected sequence. pub fn multicam_state_for_clip(p: &ProjectRef, clip: NodeId) -> Option { - let clip_ref = oaktimeline::util::NodeRef::new(p.clone(), clip); - let mc = oaktimeline::multicam::clip_find_multicam(&clip_ref)?; + let clip_ref = oak_timeline::util::NodeRef::new(p.clone(), clip); + let mc = oak_timeline::multicam::clip_find_multicam(&clip_ref)?; let sequence_id = multicam_sequence(p, mc.id)?; let source_count = multicam_source_count(p, mc.id); Some(MulticamState { @@ -193,29 +193,29 @@ pub fn clip_at_playhead_with_multicam(p: &ProjectRef, seq: NodeId, time: Rationa out }; candidates.into_iter().find(|block_id| { - let clip_ref = oaktimeline::util::NodeRef::new(p.clone(), *block_id); - oaktimeline::multicam::clip_find_multicam(&clip_ref).is_some() + let clip_ref = oak_timeline::util::NodeRef::new(p.clone(), *block_id); + oak_timeline::multicam::clip_find_multicam(&clip_ref).is_some() }) } #[cfg(test)] mod tests { use super::*; - use oaknode::block::ClipBlockBehavior; - use oaknode::node::NodeCore; - use oaknode::project::Project; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior}; + use oak_node::block::ClipBlockBehavior; + use oak_node::node::NodeCore; + use oak_node::project::Project; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior}; use std::sync::{Arc, Mutex}; - use oaktimeline::util::{ + use oak_timeline::util::{ block_clip_create, block_in, track_append_block, NodeRef, }; /// Project fixture: a sequence owning one video track list with one /// video track. struct Fixture { - project: Arc>, + project: Arc>, seq: NodeRef, track: NodeRef, } @@ -284,7 +284,7 @@ mod tests { .unwrap() .downcast_mut::() .unwrap(); - c.core.range = oakcore_rs::TimeRange::new(Rational::new(0, 1), Rational::new(50, 1)); + c.core.range = oak_core::TimeRange::new(Rational::new(0, 1), Rational::new(50, 1)); } track_append_block(&fx.track, &clip); clip @@ -328,7 +328,7 @@ mod tests { assert!(multicam_state_for_clip(&fx.project, clip.id).is_none()); // Enable multicam through the real command, then resolve. - let mut cmd = oaktimeline::multicam::MultiCamEnableCommand::new( + let mut cmd = oak_timeline::multicam::MultiCamEnableCommand::new( vec![clip.clone()], fx.seq.clone(), ); @@ -339,7 +339,7 @@ mod tests { assert_eq!(state.current_source, 0); // The connected sequence still resolves through the multicam. - let mc = oaktimeline::multicam::clip_find_multicam(&clip).unwrap(); + let mc = oak_timeline::multicam::clip_find_multicam(&clip).unwrap(); assert_eq!(multicam_sequence(&fx.project, mc.id), Some(fx.seq.id)); } @@ -402,7 +402,7 @@ mod tests { .unwrap() .downcast_mut::() .unwrap(); - c.core.range = oakcore_rs::TimeRange::new(Rational::new(0, 1), Rational::new(50, 1)); + c.core.range = oak_core::TimeRange::new(Rational::new(0, 1), Rational::new(50, 1)); } track_append_block(&track2, &mc_clip); { @@ -411,7 +411,7 @@ mod tests { .connect(fx.seq.id, mc_clip.id, clip_input::TEXTURE_INPUT, -1) .unwrap(); } - let mut cmd = oaktimeline::multicam::MultiCamEnableCommand::new( + let mut cmd = oak_timeline::multicam::MultiCamEnableCommand::new( vec![mc_clip.clone()], fx.seq.clone(), ); diff --git a/src/oakui/nodegraph.rs b/crates/oak-app/src/oakui/nodegraph.rs similarity index 97% rename from src/oakui/nodegraph.rs rename to crates/oak-app/src/oakui/nodegraph.rs index 3a98a1aff..b43ddc03e 100644 --- a/src/oakui/nodegraph.rs +++ b/crates/oak-app/src/oakui/nodegraph.rs @@ -55,7 +55,7 @@ use gpui::node_graph::{ }; use gpui::{hsla, point, px, Hsla, Pixels, Point, SharedString}; -use oaknode::id::NodeId as DomainNodeId; +use oak_node::id::NodeId as DomainNodeId; use crate::oakui::graphops::{self, ProjectRef}; @@ -296,7 +296,7 @@ struct TypedNode { /// the full `footage → effects → clip` chain. The sequence node is NOT part /// of a clip's context — the chain is self-contained, so the filtered view /// shows no output card and no synthesized clip→output wires. -fn clip_context_nodes(g: &oaknode::graph::Graph, clip: DomainNodeId) -> Vec { +fn clip_context_nodes(g: &oak_node::graph::Graph, clip: DomainNodeId) -> Vec { let mut out: Vec = Vec::new(); // The clip block card (the chain's output end). out.push(TypedNode { @@ -318,7 +318,7 @@ fn clip_context_nodes(g: &oaknode::graph::Graph, clip: DomainNodeId) -> Vec Vec { +fn graph_nodes(g: &oak_node::graph::Graph, seq: DomainNodeId) -> Vec { let mut out: Vec = g .node_ids() .into_iter() @@ -348,7 +348,7 @@ fn graph_nodes(g: &oaknode::graph::Graph, seq: DomainNodeId) -> Vec { /// The context position of `node` in the sequence's map, or the (0,0) /// sentinel the fallback layout replaces. fn context_position( - g: &oaknode::graph::Graph, + g: &oak_node::graph::Graph, seq: DomainNodeId, node: DomainNodeId, ) -> Point { @@ -587,7 +587,7 @@ fn role_of(type_id: &str, is_output: bool) -> u32 { /// sorted display order (mirrors the fallback grid in `build_graph`). /// `apply_edit` uses it so the first drag release writes /// `(displayed base + delta)` instead of `(origin + delta)`. -fn fallback_base(g: &oaknode::graph::Graph, seq: DomainNodeId, ident: u64) -> (f64, f64) { +fn fallback_base(g: &oak_node::graph::Graph, seq: DomainNodeId, ident: u64) -> (f64, f64) { let seq_ident = seq.identity(); let all = graph_nodes(g, seq); let target = all @@ -627,7 +627,7 @@ fn fallback_base(g: &oaknode::graph::Graph, seq: DomainNodeId, ident: u64) -> (f /// Resolve a domain node id from a widget identity, validating it against /// the graph. -fn find_node(g: &oaknode::graph::Graph, ident: u64) -> Result { +fn find_node(g: &oak_node::graph::Graph, ident: u64) -> Result { let Some(id) = graphops::id_of(ident) else { return Err(format!("node {ident} not found")); }; @@ -802,7 +802,7 @@ mod tests { let seq = graphops::create_sequence(&project, "Chain"); let clip = { let mut g = graphops::lock(&project); - let (core, behavior) = oaknode::block::clip_create(); + let (core, behavior) = oak_node::block::clip_create(); g.graph.add_node(core, behavior) }; // Insert the effect on the bare clip first (the chain is empty, so @@ -823,7 +823,7 @@ mod tests { .unwrap_or_default(); let footage = { let mut g = graphops::lock(&project); - let (core, behavior) = oaknode::footage::FootageBehavior::create(); + let (core, behavior) = oak_node::footage::FootageBehavior::create(); g.graph.add_node(core, behavior) }; { @@ -842,7 +842,7 @@ mod tests { #[test] fn clip_context_build_is_the_clip_chain_only() { let _g = stack_lock(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let (project, seq, clip, effect, footage) = project_with_chained_clip(); let (nodes, edges) = build_graph_for_clip(&project, seq, clip.identity()); @@ -886,6 +886,6 @@ mod tests { "the full graph synthesizes the clip→output wire" ); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } } diff --git a/src/oakui/ofx.rs b/crates/oak-app/src/oakui/ofx.rs similarity index 93% rename from src/oakui/ofx.rs rename to crates/oak-app/src/oakui/ofx.rs index aec2dee4f..567385a0d 100644 --- a/src/oakui/ofx.rs +++ b/crates/oak-app/src/oakui/ofx.rs @@ -19,7 +19,7 @@ //! The app is the only place that holds both the oakplugin host and the UI //! services the OFX suites consult at runtime, so the wiring lives here: //! -//! - [`init`] scans the standard plugin paths ([`oakplugin::host::Host`] +//! - [`init`] scans the standard plugin paths ([`oak_plugin::host::Host`] //! default path set, `host.rs:440-449`), registers every discovered //! plugin into the node factory (the effect library and the add-effect //! menu consume those entries), installs the render executor and the @@ -51,10 +51,10 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, OnceLock}; use gpui::{Keystroke, Point, RenderImage, Size}; -use oakplugin::progress::{ReporterFactory, UiProgressReporter}; -use oakplugin::suites::interact::Interact; -use oakplugin::suites::status; -use oakplugin::suites::timeline::{ActiveViewerProvider, ViewerTimeInfo}; +use oak_plugin::progress::{ReporterFactory, UiProgressReporter}; +use oak_plugin::suites::interact::Interact; +use oak_plugin::suites::status; +use oak_plugin::suites::timeline::{ActiveViewerProvider, ViewerTimeInfo}; /// One progress event a plugin reporter pushed to the app channel (drained /// by the app tick, which drives a progress dialog). @@ -136,7 +136,7 @@ pub fn update_viewer_time(time: f64, range_min: f64, range_max: f64) { pub fn update_project_extent(width: f64, height: f64) { let (w, h) = (width.max(1.0), height.max(1.0)); *extent_slot().lock().unwrap_or_else(|e| e.into_inner()) = (w, h); - oakplugin::node_factory::set_project_extent(w, h); + oak_plugin::node_factory::set_project_extent(w, h); } /// Requests cancellation of the running plugin render (the progress @@ -148,7 +148,7 @@ pub fn cancel_plugin_render() { // The worker-process plugin renders are cancelled through the control // plane (`plugin_cancel`); the in-flight frame completes (batch // granularity — the worker processes messages between batches). - oakrender::procpool::request_plugin_cancel_all(); + oak_render::procpool::request_plugin_cancel_all(); } // --------------------------------------------------------------------------- @@ -210,21 +210,21 @@ pub fn init() -> usize { // plus the OLIVE_OFX_PLUGIN_PATH / OLIVE_PLUGIN_PATH / // OFX_PLUGIN_PATH environment variables). A scan failure only // logs — plugins are optional. - if let Err(e) = oakplugin::host::Host::global().cache.scan() { + if let Err(e) = oak_plugin::host::Host::global().cache.scan() { eprintln!("[ofx] plugin scan failed: {e}"); } // 2. Register discovered plugins into the node factory (idempotent; // also installs the render executor and the plugin-node duplicator). - let registered = oakplugin::node_factory::register_plugin_nodes(); + let registered = oak_plugin::node_factory::register_plugin_nodes(); // 3. Progress reporter factory -> the app progress channel. - oakplugin::progress::set_reporter_factory(Some(reporter_factory())); + oak_plugin::progress::set_reporter_factory(Some(reporter_factory())); // 4. Active-viewer time provider (timeline suite fallback). - oakplugin::suites::timeline::set_active_viewer_provider(Some(viewer_provider())); + oak_plugin::suites::timeline::set_active_viewer_provider(Some(viewer_provider())); // 5. Worker-forwarded plugin progress (the render workers run plugin // renders in their own process and stream `plugin_progress` NDJSON // events over the control plane; the dispatcher hands them to this // callback, which feeds the same channel the inline reporter uses). - oakrender::procpool::set_plugin_progress_cb(Some(Arc::new(|label, message, fraction| { + oak_render::procpool::set_plugin_progress_cb(Some(Arc::new(|label, message, fraction| { if let Some(tx) = progress_tx() { let _ = tx.send(PluginProgressEvent { label, @@ -236,7 +236,7 @@ pub fn init() -> usize { // 6. Project extent (the engine refreshes it whenever the sequence // changes; keep the oakplugin side in sync with the default). let (w, h) = *extent_slot().lock().unwrap_or_else(|e| e.into_inner()); - oakplugin::node_factory::set_project_extent(w, h); + oak_plugin::node_factory::set_project_extent(w, h); registered.len() } @@ -272,7 +272,7 @@ impl InteractViewport { /// The app-side holder of the selected effect's live interact. /// -/// The interact is created on the *main process* `oakplugin::Instance` of +/// The interact is created on the *main process* `oak_plugin::Instance` of /// the selected plugin effect node (the same registry the inspector's /// push-button path uses), distinct from the worker-process render /// instances — OFX allows a plugin to have several instances, and the @@ -328,7 +328,7 @@ pub fn sync_active_interact(instance: Option) { let Some(id) = instance else { return; }; - let Some(inst) = oakplugin::node_factory::instance_from_id(id) else { + let Some(inst) = oak_plugin::node_factory::instance_from_id(id) else { // The node/instance is gone (effect deleted): nothing to attach to. return; }; @@ -399,7 +399,7 @@ fn bgra_image_to_f32_rgba(img: &RenderImage) -> Option<(u32, u32, Vec)> { } /// Reads an `oakplugin` F32 RGBA image into a tightly packed `Vec`. -fn read_image_f32(img: &oakplugin::image::Image) -> Vec { +fn read_image_f32(img: &oak_plugin::image::Image) -> Vec { img.pixels() .chunks_exact(4) .map(|c| f32::from_ne_bytes(c[0..4].try_into().unwrap())) @@ -477,27 +477,27 @@ pub fn draw_interact_composite( if bw != w as u32 || bh != h as u32 { return None; } - let mut params = oakplugin::render::VideoParams::default(); + let mut params = oak_plugin::render::VideoParams::default(); params.width = w; params.height = h; - params.format = oakplugin::render::PIXEL_FORMAT_F32; + params.format = oak_plugin::render::PIXEL_FORMAT_F32; - let _guard = oakplugin::gl_bridge::acquire().ok()?; - let tex = oakplugin::gl_bridge::create_output_texture(w, h, ¶ms).ok()?; - let fbo = match oakplugin::gl_bridge::create_fbo(tex, w, h) { + let _guard = oak_plugin::gl_bridge::acquire().ok()?; + let tex = oak_plugin::gl_bridge::create_output_texture(w, h, ¶ms).ok()?; + let fbo = match oak_plugin::gl_bridge::create_fbo(tex, w, h) { Ok(fbo) => fbo, Err(_) => { - oakplugin::gl_bridge::delete_gl_texture(tex); + oak_plugin::gl_bridge::delete_gl_texture(tex); return None; } }; - oakplugin::gl_bridge::bind_fbo(fbo); - oakplugin::gl_bridge::set_viewport(w, h); + oak_plugin::gl_bridge::bind_fbo(fbo); + oak_plugin::gl_bridge::set_viewport(w, h); // Clear to transparent black: the plugin's strokes composite "over" // nothing, so the readback holds straight alpha (see // [`composite_overlay`]). - oakplugin::gl_bridge::gl_clear_color(0.0, 0.0, 0.0, 0.0); - oakplugin::gl_bridge::gl_clear(); + oak_plugin::gl_bridge::gl_clear_color(0.0, 0.0, 0.0, 0.0); + oak_plugin::gl_bridge::gl_clear(); let st = interact.draw( (viewport.width, viewport.height), @@ -508,9 +508,9 @@ pub fn draw_interact_composite( // composited on the app side afterwards). None, ); - let overlay = oakplugin::gl_bridge::read_pixels_to_image(w, h, ¶ms); - oakplugin::gl_bridge::delete_fbo(fbo); - oakplugin::gl_bridge::delete_gl_texture(tex); + let overlay = oak_plugin::gl_bridge::read_pixels_to_image(w, h, ¶ms); + oak_plugin::gl_bridge::delete_fbo(fbo); + oak_plugin::gl_bridge::delete_gl_texture(tex); let (Ok(overlay), st) = (overlay, st) else { return None; }; @@ -554,15 +554,15 @@ pub fn viewport_pixel_to_pen( } /// Maps a gpui keystroke to the OFX key symbol (`ofxKeySyms.h` values from -/// `oakplugin::host::KEY_*`) and the key-string character +/// `oak_plugin::host::KEY_*`) and the key-string character /// (`kOfxPropKeyString`: the UTF-8 character, empty for keys without one). /// /// Covers the common keys — alphanumerics, the arrows, return, escape, /// backspace/delete, tab, home/end, page up/down and the function keys; -/// anything else maps to [`oakplugin::host::KEY_UNKNOWN`] with an empty +/// anything else maps to [`oak_plugin::host::KEY_UNKNOWN`] with an empty /// string. pub fn key_symbol(keystroke: &Keystroke) -> (i32, String) { - use oakplugin::host as ofx_key; + use oak_plugin::host as ofx_key; let key = keystroke.key.as_str(); let named = match key { "space" => Some(ofx_key::KEY_SPACE), @@ -703,7 +703,7 @@ mod tests { /// single characters carry their ASCII symbol + the character string. #[test] fn key_symbol_maps_common_keys() { - use oakplugin::host as ofx_key; + use oak_plugin::host as ofx_key; let ks = |key: &str| gpui::Keystroke::parse(key).unwrap(); // Alphanumerics: symbol = ASCII code, string = the char. assert_eq!(key_symbol(&ks("a")), (ofx_key::KEY_A, "a".to_string())); @@ -823,11 +823,11 @@ mod tests { println!("SKIP: minimal test plugin not built"); return false; }; - if oakplugin::host::Host::global().cache.scan_path(&dir).is_err() { + if oak_plugin::host::Host::global().cache.scan_path(&dir).is_err() { println!("SKIP: test plugin scan failed"); return false; } - oakplugin::node_factory::register_plugin_nodes(); + oak_plugin::node_factory::register_plugin_nodes(); true } @@ -863,10 +863,10 @@ mod tests { // (1) app-layer creation: `sync_active_interact` on the plugin // instance handle creates the interact (new_interact → describe → // create_instance). - let inst = oakplugin::host::Host::global() + let inst = oak_plugin::host::Host::global() .create_instance(INTERACT_PLUGIN_ID, None) .expect("interact variant instance"); - let handle = oakplugin::node_factory::register_instance(inst); + let handle = oak_plugin::node_factory::register_instance(inst); sync_active_interact(Some(handle)); let (active_handle, interact, _viewport) = @@ -887,11 +887,11 @@ mod tests { // (3) keys and idle. assert_eq!( - interact.key_down(oakplugin::host::KEY_A, "a", 5.0), + interact.key_down(oak_plugin::host::KEY_A, "a", 5.0), status::OK ); assert_eq!( - interact.key_up(oakplugin::host::KEY_A, "a", 5.0), + interact.key_up(oak_plugin::host::KEY_A, "a", 5.0), status::OK ); assert_eq!(interact.idle(), status::OK); @@ -959,7 +959,7 @@ mod tests { "idle not recorded: {lines:?}" ); - oakplugin::host::Host::global().shutdown(); + oak_plugin::host::Host::global().shutdown(); } /// End-to-end overlay: the plugin's draw action really renders into the @@ -979,10 +979,10 @@ mod tests { let _ = std::fs::remove_file(&marker); unsafe { std::env::set_var(MARKER_ENV, &marker) }; - let inst = oakplugin::host::Host::global() + let inst = oak_plugin::host::Host::global() .create_instance(INTERACT_PLUGIN_ID, None) .expect("interact variant instance"); - let handle = oakplugin::node_factory::register_instance(inst); + let handle = oak_plugin::node_factory::register_instance(inst); sync_active_interact(Some(handle)); let (_, interact, _) = active_interact().expect("active interact created"); @@ -1035,6 +1035,6 @@ mod tests { ); sync_active_interact(None); - oakplugin::host::Host::global().shutdown(); + oak_plugin::host::Host::global().shutdown(); } } diff --git a/src/oakui/projectbrowser.rs b/crates/oak-app/src/oakui/projectbrowser.rs similarity index 92% rename from src/oakui/projectbrowser.rs rename to crates/oak-app/src/oakui/projectbrowser.rs index c2f3da1a4..e84a501f8 100644 --- a/src/oakui/projectbrowser.rs +++ b/crates/oak-app/src/oakui/projectbrowser.rs @@ -25,13 +25,13 @@ use gpui_widgets::project_explorer::ProjectEntry; -use oaknode::folder::FolderBehavior; -use oaknode::id::NodeId; +use oak_node::folder::FolderBehavior; +use oak_node::id::NodeId; use crate::oakui::graphops::{self, ProjectRef}; /// One child entry of a folder with its identity. -fn child_entry(g: &oaknode::graph::Graph, child: NodeId) -> Option { +fn child_entry(g: &oak_node::graph::Graph, child: NodeId) -> Option { let entry = g.get(child)?; let mut name = entry.core.label.clone(); if name.is_empty() { @@ -45,7 +45,7 @@ fn child_entry(g: &oaknode::graph::Graph, child: NodeId) -> Option } /// The children of a folder node. -fn folder_children(g: &oaknode::graph::Graph, folder: NodeId) -> Vec { +fn folder_children(g: &oak_node::graph::Graph, folder: NodeId) -> Vec { let Some(f) = g .get(folder) .and_then(|e| e.behavior.as_any()) diff --git a/src/oakui/real.rs b/crates/oak-app/src/oakui/real.rs similarity index 96% rename from src/oakui/real.rs rename to crates/oak-app/src/oakui/real.rs index ced45a5b1..d0e595715 100644 --- a/src/oakui/real.rs +++ b/crates/oak-app/src/oakui/real.rs @@ -19,10 +19,10 @@ //! [`EngineGateway`](super::engine::EngineGateway) / //! [`AppEngine`](super::engine::AppEngine) seam the mock implements. //! -//! The engine owns the domain project (`Arc>`) +//! The engine owns the domain project (`Arc>`) //! and the current sequence's `NodeId`; every read is a direct graph walk //! and every edit is an oaktimeline/oakundo command pushed onto the -//! process-wide undo stack ([`oakundo::global`]). The assembly-layer +//! process-wide undo stack ([`oak_undo::global`]). The assembly-layer //! helpers live in [`super::graphops`] (project/timeline/storage), //! [`super::effectchain`] (effect chains) and [`super::renderops`] //! (montage resolution, ticket rendering, the export driver); the @@ -48,7 +48,7 @@ //! audio device selection additionally applies live through oakaudio's //! manager. //! * **Storage** — the write-through library binds every opened project -//! through [`oakstorage::writethrough`]; the manager window's library +//! through [`oak_storage::writethrough`]; the manager window's library //! operations call the oakstorage database backend directly. //! //! # Threading note @@ -78,12 +78,12 @@ use gpui_widgets::audio_meter::AudioMeterDataSource; use gpui_widgets::project_explorer::{ProjectDataSource, ProjectEntry}; use gpui_widgets::viewer::PlaybackClock; -use oaknode::id::NodeId; -use oaknode::track::TrackType; -use oakrender::manager::RenderManager; -use oakrender::procpool::{bgra8_to_rgba8, ShmFrameRef}; -use oaktimeline::handle::CHandle; -use oaktimeline::util::NodeRef; +use oak_node::id::NodeId; +use oak_node::track::TrackType; +use oak_render::manager::RenderManager; +use oak_render::procpool::{bgra8_to_rgba8, ShmFrameRef}; +use oak_timeline::handle::CHandle; +use oak_timeline::util::NodeRef; use super::engine::{ AppEngine, EngineGateway, ExportSession, LibraryProject, Monitor, MulticamState, Project, @@ -1114,12 +1114,12 @@ impl RealEngine { // Packed F32; layout: 1ch → mono mask, else stereo. let layout: u64 = if buf.channel_count == 1 { 0x4 } else { 0x3 }; let bytes: Vec = buf.data.iter().flat_map(|v| v.to_ne_bytes()).collect(); - if let Some(mut manager) = oakaudio::manager::instance() { + if let Some(mut manager) = oak_audio::manager::instance() { let _ = manager.push_to_output( - oakaudio::params::AudioParams { + oak_audio::params::AudioParams { sample_rate: buf.sample_rate, channel_layout: layout, - format: oakcore_rs::SampleFormat::F32, + format: oak_core::SampleFormat::F32, }, &bytes, &mut [], @@ -1724,12 +1724,12 @@ impl RealEngine { let distance = frame.saturating_sub(playhead).abs(); let version = self.preview_generation; let preview_windows = self.preview_windows.clone(); - let done: oakrender::ticket::Completion = Box::new(move |result| { + let done: oak_render::ticket::Completion = Box::new(move |result| { let mut windows = preview_windows.lock().unwrap_or_else(|e| e.into_inner()); let window = windows.entry(monitor).or_default(); match result { - Ok(oakrender::ticket::TicketPayload::ShmFrame(slot)) => { + Ok(oak_render::ticket::TicketPayload::ShmFrame(slot)) => { // The rendered frame is cached in its shm slot until // the playhead reaches it (cpu_frame) or it falls out // of the window. @@ -1983,7 +1983,7 @@ impl RealEngine { fn proxy_cache_path() -> String { let configured = config_get_string(CONFIG_KEY_DISK_CACHE_PATH); if configured.trim().is_empty() { - oakcommon::filefunctions::default_disk_cache_path() + oak_common::filefunctions::default_disk_cache_path() } else { configured } @@ -2032,7 +2032,7 @@ impl RealEngine { .graph .get_mut(*footage) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { if *ok { // The transcode wrote the final file: mark the @@ -2062,7 +2062,7 @@ impl RealEngine { /// recorded failure (state 3) preserved while no file is on disk. fn proxy_state_of( &self, - f: &oaknode::footage::FootageBehavior, + f: &oak_node::footage::FootageBehavior, node: NodeId, ) -> super::engine::ProxyMediaState { use super::engine::ProxyMediaState; @@ -2072,9 +2072,9 @@ impl RealEngine { if f.proxy.is_empty() { return ProxyMediaState::Missing; } - match oakcodec::proxymanager::ProxyManager::get_proxy_state(&f.proxy) { - oakcodec::proxymanager::ProxyState::Ready => ProxyMediaState::Ready, - oakcodec::proxymanager::ProxyState::Generating => ProxyMediaState::Generating, + match oak_codec::proxymanager::ProxyManager::get_proxy_state(&f.proxy) { + oak_codec::proxymanager::ProxyState::Ready => ProxyMediaState::Ready, + oak_codec::proxymanager::ProxyState::Generating => ProxyMediaState::Generating, _ => { if f.proxy_state == 3 { ProxyMediaState::Failed @@ -2092,7 +2092,7 @@ impl RealEngine { /// every clip is re-placed so its source head lines up with the /// reference's at the anchor (one multi-undo). fn sync_clips_by_source_time_internal(&mut self, clips: &[ClipId]) { - use oakaudio::synchronizer::{place_by_source_time, SourceClip}; + use oak_audio::synchronizer::{place_by_source_time, SourceClip}; let Some(project) = self.project.clone() else { return; @@ -2104,8 +2104,8 @@ impl RealEngine { list: NodeId, track_index: i32, source: SourceClip, - source_head: oakcore_rs::Rational, - block_in: oakcore_rs::Rational, + source_head: oak_core::Rational, + block_in: oak_core::Rational, } let mut targets: Vec = Vec::new(); @@ -2168,7 +2168,7 @@ impl RealEngine { // (node, track, list, track index, placement) for every valid // placement (the reference itself lands on the anchor). - let mut placements: Vec<(NodeId, NodeId, NodeId, i32, oakcore_rs::Rational)> = + let mut placements: Vec<(NodeId, NodeId, NodeId, i32, oak_core::Rational)> = Vec::new(); for target in &targets { let placement = place_by_source_time(&reference.source, &target.source, anchor_in); @@ -2186,10 +2186,10 @@ impl RealEngine { return; } - let mut children: Vec = Vec::new(); + let mut children: Vec = Vec::new(); for (node, track, _, _, _) in &placements { children.push( - oaktimeline::undogeneral::TrackReplaceBlockWithGapCommand::new( + oak_timeline::undogeneral::TrackReplaceBlockWithGapCommand::new( graphops::node_ref(&project, *track), graphops::node_ref(&project, *node), false, @@ -2199,7 +2199,7 @@ impl RealEngine { } for (node, _, list, track_index, timeline_in) in &placements { children.push( - oaktimeline::undopointer::TrackPlaceBlockCommand::new( + oak_timeline::undopointer::TrackPlaceBlockCommand::new( graphops::node_ref(&project, *list), *track_index, graphops::node_ref(&project, *node), @@ -2218,8 +2218,8 @@ impl RealEngine { /// offset triggers a rate search whose winner also rescales the clip /// speed (one multi-undo). fn sync_clips_by_waveform_internal(&mut self, clips: &[ClipId], allow_speed: bool) { - use oakaudio::synchronizer::place_by_waveform_offset; - use oakaudio::waveformsync::{estimate_envelope_offset_valid, estimate_stretch_and_offset}; + use oak_audio::synchronizer::place_by_waveform_offset; + use oak_audio::waveformsync::{estimate_envelope_offset_valid, estimate_stretch_and_offset}; let Some(cache) = self.waveform_cache() else { return; @@ -2233,7 +2233,7 @@ impl RealEngine { track: NodeId, list: NodeId, track_index: i32, - block_in: oakcore_rs::Rational, + block_in: oak_core::Rational, speed: f64, media_in_s: f64, media_len_s: f64, @@ -2318,7 +2318,7 @@ impl RealEngine { NodeId, NodeId, i32, - oakcore_rs::Rational, + oak_core::Rational, f64, f64, )> = vec![( @@ -2381,7 +2381,7 @@ impl RealEngine { } let placement = place_by_waveform_offset(reference.block_in, offset.offset_samples, sample_rate); - if placement.valid && placement.timeline_in >= oakcore_rs::Rational::new(0, 1) { + if placement.valid && placement.timeline_in >= oak_core::Rational::new(0, 1) { placements.push(( target.node, target.track, @@ -2397,10 +2397,10 @@ impl RealEngine { return; } - let mut children: Vec = Vec::new(); + let mut children: Vec = Vec::new(); for (node, track, _, _, _, speed, old_speed) in &placements { children.push( - oaktimeline::undogeneral::TrackReplaceBlockWithGapCommand::new( + oak_timeline::undogeneral::TrackReplaceBlockWithGapCommand::new( graphops::node_ref(&project, *track), graphops::node_ref(&project, *node), false, @@ -2415,14 +2415,14 @@ impl RealEngine { let old_speed = *old_speed; let node = *node; let (p1, p2) = (project.clone(), project.clone()); - children.push(oakundo::undocommand::UndoCommand::from_closures( + children.push(oak_undo::undocommand::UndoCommand::from_closures( move || { let mut g = graphops::lock(&p1); if let Some(c) = g .graph .get_mut(node) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { c.core.speed = new_speed; } @@ -2433,7 +2433,7 @@ impl RealEngine { .graph .get_mut(node) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { c.core.speed = old_speed; } @@ -2443,7 +2443,7 @@ impl RealEngine { } for (node, _, list, track_index, timeline_in, _, _) in &placements { children.push( - oaktimeline::undopointer::TrackPlaceBlockCommand::new( + oak_timeline::undopointer::TrackPlaceBlockCommand::new( graphops::node_ref(&project, *list), *track_index, graphops::node_ref(&project, *node), @@ -2462,7 +2462,7 @@ impl RealEngine { /// library. Projects without a sequence get a blank default. fn adopt_project(&mut self, project: ProjectRef, cx: &mut Context) { self.drop_project(); - oakundo::global::clear().ok(); + oak_undo::global::clear().ok(); // Cached display info. let (name, path, first_sequence) = { @@ -2509,7 +2509,7 @@ impl RealEngine { fn drop_project(&mut self) { *self.renderer.lock().unwrap() = RendererSlot::Untried; *self.source_renderer.lock().unwrap() = RendererSlot::Untried; - oakundo::global::clear().ok(); + oak_undo::global::clear().ok(); if let Some(mut markers) = self.markers.take() { graphops::release_handle(&mut markers.0); } @@ -2648,7 +2648,7 @@ impl RealEngine { /// Snapshots one track (with its clips) from the graph. fn snapshot_track( - graph: &oaknode::graph::Graph, + graph: &oak_node::graph::Graph, track: NodeId, kind: TrackType, track_index: usize, @@ -2662,7 +2662,7 @@ impl RealEngine { // Height in internal units → pixels. let height = graphops::track_behavior(graph, track) .map(|t| { - px(oaknode::track::internal_height_to_pixel_height(t.height).max(24) as f32) + px(oak_node::track::internal_height_to_pixel_height(t.height).max(24) as f32) }) .unwrap_or(px(64.0)); let clips = graphops::clip_ids(graph, track) @@ -2670,7 +2670,7 @@ impl RealEngine { .enumerate() .filter_map(|(clip_index, &block)| { let (in_r, out_r, media_r) = graphops::clip_range(graph, block)?; - let to_ts = |r: oakcore_rs::Rational| tb.map(|tb| graphops::rational_to_ts(r, tb)).unwrap_or(0); + let to_ts = |r: oak_core::Rational| tb.map(|tb| graphops::rational_to_ts(r, tb)).unwrap_or(0); Some(RealClip { id: ClipId(block.identity()), range: FrameRange::new(Frame(to_ts(in_r)), Frame(to_ts(out_r))), @@ -2844,7 +2844,7 @@ impl RealEngine { let type_id = graphops::node_type_id(&guard.graph, node); // `name_of` covers both static (built-in) and dynamic (OpenFX // plugin) factory entries. - let title = oaknode::factory::Factory::global() + let title = oak_node::factory::Factory::global() .name_of(&type_id) .filter(|n| !n.is_empty()) .unwrap_or(type_id); @@ -2853,7 +2853,7 @@ impl RealEngine { // simplified 徽标/计数 of stage 6b). Built-in effects show none. let badge = plugin_handle.and_then(|handle| { let count = - oakplugin::suites::message::persistent_message_count(handle as usize); + oak_plugin::suites::message::persistent_message_count(handle as usize); (count > 0).then_some(count) }); let subtitle = plugin_handle.map(|_| { @@ -2897,7 +2897,7 @@ impl RealEngine { /// waveform sync extracts its envelope over (`media_in + length`, speed /// and reverse ignored there; parity with /// `oakengine_clip_get_media_range_rational`). -fn clip_media_length_seconds(g: &oaknode::graph::Graph, node: NodeId) -> f64 { +fn clip_media_length_seconds(g: &oak_node::graph::Graph, node: NodeId) -> f64 { match graphops::clip_range(g, node) { Some((in_r, out_r, _)) => (out_r - in_r).to_f64(), None => 0.0, @@ -3143,7 +3143,7 @@ impl AudioMeterDataSource for RealEngine { // (oakaudio's manager, clamped to the meter's 0..1 range). Silent // when nothing has been pushed to the output (no playback audio // path yet) or without an AudioManager instance. - let Some(manager) = oakaudio::manager::instance() else { + let Some(manager) = oak_audio::manager::instance() else { return vec![0.0, 0.0]; }; let mut peaks = [0.0f32; 8]; @@ -3287,7 +3287,7 @@ impl AppEngine for RealEngine { let (Some(project), Some(seq)) = (self.project.clone(), self.sequence) else { return; }; - let internal = oaknode::track::pixel_height_to_internal_height(f32::from(height) as i32); + let internal = oak_node::track::pixel_height_to_internal_height(f32::from(height) as i32); let guard = graphops::lock(&project); for kind in [TrackType::Video, TrackType::Audio, TrackType::Subtitle] { for track in graphops::track_ids(&guard.graph, seq, kind) { @@ -3363,7 +3363,7 @@ impl AppEngine for RealEngine { &mut self, effect: EffectId, input_id: &str, - value: oaknode::value::NodeValue, + value: oak_node::value::NodeValue, cx: &mut Context, ) -> Result<(), String> { let Some(project) = self.project.clone() else { @@ -3394,7 +3394,7 @@ impl AppEngine for RealEngine { return Err("not a plugin effect".into()); }; drop(guard); - if !oakplugin::node_factory::push_button_clicked(instance, input_id) { + if !oak_plugin::node_factory::push_button_clicked(instance, input_id) { return Err(format!("push button \"{input_id}\" not found")); } // A button press can change the plugin's other parameters; refresh @@ -3663,7 +3663,7 @@ impl AppEngine for RealEngine { TimelineEvent::TrackHeightChanged { track, height } => { if let (Some(t), Some(project)) = (self.tracks.get(*track), self.project.clone()) { let internal = - oaknode::track::pixel_height_to_internal_height(f32::from(*height) as i32); + oak_node::track::pixel_height_to_internal_height(f32::from(*height) as i32); graphops::set_track_height(&project, t.track, internal); self.rebuild_timeline(); } @@ -3798,7 +3798,7 @@ impl AppEngine for RealEngine { graphops::workarea_set( &wa.0, true, - oakcore_rs::TimeRange::new( + oak_core::TimeRange::new( graphops::ts_to_rational(start.0, tb), graphops::ts_to_rational(end.0, tb), ), @@ -3820,11 +3820,11 @@ impl AppEngine for RealEngine { let result = graphops::workarea_set_undoable( &wa.0, true, - oakcore_rs::TimeRange::new( + oak_core::TimeRange::new( graphops::ts_to_rational(start.0, tb), graphops::ts_to_rational(end.0, tb), ), - oakcore_rs::TimeRange::new( + oak_core::TimeRange::new( graphops::ts_to_rational(old_start.0, tb), graphops::ts_to_rational(old_end.0, tb), ), @@ -3840,11 +3840,11 @@ impl AppEngine for RealEngine { let result = graphops::workarea_set_undoable( &wa.0, false, - oakcore_rs::TimeRange::new( + oak_core::TimeRange::new( graphops::ts_to_rational(old_start.0, tb), graphops::ts_to_rational(old_end.0, tb), ), - oakcore_rs::TimeRange::new( + oak_core::TimeRange::new( graphops::ts_to_rational(old_start.0, tb), graphops::ts_to_rational(old_end.0, tb), ), @@ -3915,23 +3915,23 @@ impl AppEngine for RealEngine { } fn can_undo(&self) -> bool { - self.project.is_some() && oakundo::global::undoable() + self.project.is_some() && oak_undo::global::undoable() } fn can_redo(&self) -> bool { - self.project.is_some() && oakundo::global::redoable() + self.project.is_some() && oak_undo::global::redoable() } fn undo(&mut self, cx: &mut Context) { if self.project.is_some() { - oakundo::global::undo().ok(); + oak_undo::global::undo().ok(); self.apply_stack_change(cx); } } fn redo(&mut self, cx: &mut Context) { if self.project.is_some() { - oakundo::global::redo().ok(); + oak_undo::global::redo().ok(); self.apply_stack_change(cx); } } @@ -3943,18 +3943,18 @@ impl AppEngine for RealEngine { // The C++ `HistoryModel` lists every row of the engine stack (done // first, then the redoable tail); labels are read through the same // two-stage contract the C++ `oakengine_undo_command_text` uses. - let count = oakundo::global::count().unwrap_or(0); + let count = oak_undo::global::count().unwrap_or(0); (0..count) .map(|row| super::HistoryEntry { - name: oakundo::global::command_name(row).unwrap_or_default(), - done: oakundo::global::command_done(row).unwrap_or(false), + name: oak_undo::global::command_name(row).unwrap_or_default(), + done: oak_undo::global::command_done(row).unwrap_or(false), }) .collect() } fn history_index(&self) -> i64 { if self.project.is_some() { - oakundo::global::index().unwrap_or(0) + oak_undo::global::index().unwrap_or(0) } else { 0 } @@ -3962,7 +3962,7 @@ impl AppEngine for RealEngine { fn jump_history(&mut self, index: i64, cx: &mut Context) { if self.project.is_some() { - oakundo::global::jump(index).ok(); + oak_undo::global::jump(index).ok(); self.apply_stack_change(cx); } } @@ -4055,7 +4055,7 @@ impl AppEngine for RealEngine { .graph .get_mut(footage) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) else { return Err("entry is not footage".into()); }; @@ -4275,7 +4275,7 @@ impl AppEngine for RealEngine { } fn set_use_proxy_media(&mut self, enabled: bool, cx: &mut Context) { - oakcommon::configstore::ConfigStore::instance().set( + oak_common::configstore::ConfigStore::instance().set( None, CONFIG_KEY_USE_PROXY, if enabled { "true" } else { "false" }, @@ -4289,7 +4289,7 @@ impl AppEngine for RealEngine { /// Resolution ▸` menu): the preview geometry changes, so every cached /// and in-flight preview frame is stale. fn set_playback_divider(&mut self, divider: i64, cx: &mut Context) { - oakcommon::configstore::ConfigStore::instance().set( + oak_common::configstore::ConfigStore::instance().set( None, "PlaybackDivider", ÷r.clamp(1, 8).to_string(), @@ -4354,7 +4354,7 @@ impl AppEngine for RealEngine { (f.filename.clone(), stream, f.effective_proxy_params()) }; - let proxy_path = oakcodec::proxymanager::ProxyManager::get_proxy_filename( + let proxy_path = oak_codec::proxymanager::ProxyManager::get_proxy_filename( &Self::proxy_cache_path(), &filename, stream_index, @@ -4369,8 +4369,8 @@ impl AppEngine for RealEngine { } else { (0, 0) }; - let request = oakcodec::task::TaskRequest { - kind: oakcodec::task::TaskKind::Proxy, + let request = oak_codec::task::TaskRequest { + kind: oak_codec::task::TaskKind::Proxy, input_filename: &filename, output_filename: &proxy_path, stream_index, @@ -4380,7 +4380,7 @@ impl AppEngine for RealEngine { proxy_width, proxy_height, }; - let task_params = oaktask::proxy::ProxyParams { + let task_params = oak_task::proxy::ProxyParams { width: params.width, height: params.height, divider: params.divider, @@ -4407,21 +4407,21 @@ impl AppEngine for RealEngine { let label = format!("Generating Proxy {}", filename); let (tx, rx) = mpsc::channel::(); - let mut driver = oaktask::task::Task::new(&label, None); + let mut driver = oak_task::task::Task::new(&label, None); { let tx = tx.clone(); driver.set_event_listener(Box::new(move |event| { let event = match event { - oaktask::task::TaskEvent::Started => super::engine::ExportEvent::Started, - oaktask::task::TaskEvent::Progress(value) => { + oak_task::task::TaskEvent::Started => super::engine::ExportEvent::Started, + oak_task::task::TaskEvent::Progress(value) => { super::engine::ExportEvent::Progress(value) } - oaktask::task::TaskEvent::Finished => return, + oak_task::task::TaskEvent::Finished => return, }; let _ = tx.send(event); })); } - driver.set_behavior(Box::new(oaktask::proxy::ProxyTask::new( + driver.set_behavior(Box::new(oak_task::proxy::ProxyTask::new( &request, task_params, ))); @@ -4447,7 +4447,7 @@ impl AppEngine for RealEngine { .graph .get_mut(footage) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { f.set_proxy(&proxy_path, 1, stream_index, params.version, true); } @@ -4483,7 +4483,7 @@ impl AppEngine for RealEngine { } }; let _ = std::fs::remove_file(&proxy_path); - if let Ok(working) = oakcodec::proxymanager::ProxyManager::get_working_filename(&proxy_path) + if let Ok(working) = oak_codec::proxymanager::ProxyManager::get_working_filename(&proxy_path) { let _ = std::fs::remove_file(&working); } @@ -4493,7 +4493,7 @@ impl AppEngine for RealEngine { .graph .get_mut(footage) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { f.clear_proxy(); } @@ -4511,7 +4511,7 @@ impl AppEngine for RealEngine { .graph .get_mut(footage) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { f.proxy_enabled = enabled; } @@ -4557,7 +4557,7 @@ impl AppEngine for RealEngine { .graph .get_mut(footage) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { f.set_custom_proxy_params(params.to_codec()); } @@ -4575,7 +4575,7 @@ impl AppEngine for RealEngine { .graph .get_mut(footage) .and_then(|e| e.behavior.as_any_mut()) - .and_then(|a| a.downcast_mut::()) + .and_then(|a| a.downcast_mut::()) { f.clear_custom_proxy_params(); } @@ -4741,7 +4741,7 @@ impl AppEngine for RealEngine { continue; } let clip_ref = NodeRef::new(project.clone(), block); - if oaktimeline::multicam::clip_find_multicam(&clip_ref).is_some() { + if oak_timeline::multicam::clip_find_multicam(&clip_ref).is_some() { return true; } } @@ -4790,21 +4790,21 @@ impl AppEngine for RealEngine { let children: Vec<_> = by_seq .into_iter() .map(|(seq, clips)| { - oaktimeline::multicam::multicam_enable( + oak_timeline::multicam::multicam_enable( clips, NodeRef::new(project.clone(), seq), ) }) .collect(); - let label = oaktimeline::multicam::enable_label(eligible.len()); + let label = oak_timeline::multicam::enable_label(eligible.len()); graphops::push_multi_command(children, &label) } else { let clip_refs: Vec = all_clips .iter() .map(|block| NodeRef::new(project.clone(), *block)) .collect(); - let label = oaktimeline::multicam::disable_label(all_clips.len()); - graphops::push_command(oaktimeline::multicam::multicam_disable(clip_refs), &label) + let label = oak_timeline::multicam::disable_label(all_clips.len()); + graphops::push_command(oak_timeline::multicam::multicam_disable(clip_refs), &label) }; self.apply_edit(result, "multicam enable/disable", cx); } @@ -4826,14 +4826,14 @@ impl AppEngine for RealEngine { return; }; let playhead = graphops::sequence_playhead(&graphops::lock(&project).graph, seq); - let cmd = oaktimeline::multicam::multicam_switch( + let cmd = oak_timeline::multicam::multicam_switch( NodeRef::new(project.clone(), clip), source, split_clip, playhead, ); let result = - graphops::push_command(cmd, oaktimeline::multicam::SWITCH_LABEL); + graphops::push_command(cmd, oak_timeline::multicam::SWITCH_LABEL); self.apply_edit(result, "multicam switch", cx); } @@ -4897,11 +4897,11 @@ impl RealEngine { fn open_interchange(&mut self, path: &PathBuf, cx: &mut Context) -> Result<(), String> { let title = format!("Loading '{}'", path.display()); let result: Arc>> = Arc::new(Mutex::new(None)); - let mut driver = oaktask::task::Task::new(&title, None); + let mut driver = oak_task::task::Task::new(&title, None); driver.set_behavior(Box::new(OtioLoadBehavior { - inner: oaktask::project::loadotio::LoadOTIOTask::new( - oaktask::project::load::ProjectLoadBaseTask::new( - oaktask::task::Task::new(&title, None), + inner: oak_task::project::loadotio::LoadOTIOTask::new( + oak_task::project::load::ProjectLoadBaseTask::new( + oak_task::task::Task::new(&title, None), path.to_string_lossy().into_owned(), ), ), @@ -4958,9 +4958,9 @@ impl RealEngine { return Err("no project open".into()); }; let filename = path.to_string_lossy().into_owned(); - let mut driver = oaktask::task::Task::new("Saving project...", None); - driver.set_behavior(Box::new(oaktask::project::saveotio::SaveOTIOTask { - base: oaktask::task::Task::new("Saving project...", None), + let mut driver = oak_task::task::Task::new("Saving project...", None); + driver.set_behavior(Box::new(oak_task::project::saveotio::SaveOTIOTask { + base: oak_task::task::Task::new("Saving project...", None), project, filename, })); @@ -4998,13 +4998,13 @@ impl RealEngine { /// pattern). struct OtioLoadBehavior { /// The module load task. - inner: oaktask::project::loadotio::LoadOTIOTask, + inner: oak_task::project::loadotio::LoadOTIOTask, /// The result slot (the loaded project). result: Arc>>, } -impl oaktask::task::TaskBehavior for OtioLoadBehavior { - fn run(&mut self, task: &mut oaktask::task::Task) -> oaktask::error::Result<()> { +impl oak_task::task::TaskBehavior for OtioLoadBehavior { + fn run(&mut self, task: &mut oak_task::task::Task) -> oak_task::error::Result<()> { self.inner.run(task)?; if let Ok(project) = self.inner.base.take_project() { *self.result.lock().unwrap_or_else(|e| e.into_inner()) = Some(project); @@ -5019,14 +5019,14 @@ impl oaktask::task::TaskBehavior for OtioLoadBehavior { /// Pure helper so the export dialog can be unit tested. pub fn encoding_formats() -> Vec<(i32, String, String)> { let mut out = Vec::new(); - for i in 0..(oakcodec::exportformat::Format::Count as i32) { - let Some(format) = oakcodec::exportformat::Format::from_i32(i) else { + for i in 0..(oak_codec::exportformat::Format::Count as i32) { + let Some(format) = oak_codec::exportformat::Format::from_i32(i) else { continue; }; out.push(( i, - oakcodec::exportformat::Format::get_name(format), - oakcodec::exportformat::Format::get_extension(format), + oak_codec::exportformat::Format::get_name(format), + oak_codec::exportformat::Format::get_extension(format), )); } out @@ -5081,8 +5081,8 @@ pub const DEFAULT_SNAPSHOT_INTERVAL_SEC: i64 = 600; pub const DEFAULT_TRANSITION_SEC: &str = "0.5"; /// The process-wide config store. -fn config_store() -> &'static oakcommon::configstore::ConfigStore { - oakcommon::configstore::ConfigStore::instance() +fn config_store() -> &'static oak_common::configstore::ConfigStore { + oak_common::configstore::ConfigStore::instance() } /// Loads the persisted configuration from disk (once at startup, before @@ -5161,12 +5161,12 @@ pub fn set_theme_dark(dark: bool) { /// The host's audio output device names in enumeration order (the index is /// what the manager's `set_output_device` takes). pub fn audio_output_devices() -> Vec { - oakaudio::manager::output_device_names() + oak_audio::manager::output_device_names() } /// The host's audio input device names (see [`audio_output_devices`]). pub fn audio_input_devices() -> Vec { - oakaudio::manager::input_device_names() + oak_audio::manager::input_device_names() } /// Selects the output device by NAME (empty = system default), persists the @@ -5177,9 +5177,9 @@ pub fn set_audio_output_device(name: &str) { let index = if name.is_empty() { -1 } else { - oakaudio::manager::device_index_by_name(name, true).unwrap_or(-1) + oak_audio::manager::device_index_by_name(name, true).unwrap_or(-1) }; - if let Some(mut manager) = oakaudio::manager::instance() { + if let Some(mut manager) = oak_audio::manager::instance() { manager.set_output_device(index).ok(); } } @@ -5191,9 +5191,9 @@ pub fn set_audio_input_device(name: &str) { let index = if name.is_empty() { -1 } else { - oakaudio::manager::device_index_by_name(name, false).unwrap_or(-1) + oak_audio::manager::device_index_by_name(name, false).unwrap_or(-1) }; - if let Some(mut manager) = oakaudio::manager::instance() { + if let Some(mut manager) = oak_audio::manager::instance() { manager.set_input_device(index).ok(); } } @@ -5223,7 +5223,7 @@ pub fn audio_input_device() -> String { /// choices. Called once at startup; without an instance `push_to_output` /// fails silently and playback stays video-only. pub fn audio_init_from_config() { - oakaudio::manager::ManagerInner::create_instance().ok(); + oak_audio::manager::ManagerInner::create_instance().ok(); let output = config_get_string(CONFIG_KEY_AUDIO_OUTPUT); if !output.is_empty() { set_audio_output_device(&output); @@ -5469,7 +5469,7 @@ mod tests { // add_track returns the NEW track's index: with the default 2V+2A // layout those are the third video and third audio track. assert_eq!((v, a), (2, 2), "in-memory tracks"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); // Save as uncompressed `.ovexml` (the module serializer reads plain // XML). @@ -5590,7 +5590,7 @@ mod tests { "oakapp_e2e_media_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10) + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10) .expect("generate e2e test media"); let footage = graphops::import_footage(&project, &media).expect("import_footage"); graphops::add_track(&project, seq, TrackType::Video).expect("add a video track"); @@ -5622,7 +5622,7 @@ mod tests { // Invalid geometry is rejected. assert!(crate::oakui::renderops::render_sequence_frame(&project, seq, 0, tb, 0, 270).is_err()); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -5637,8 +5637,8 @@ mod tests { fn process_backend_preview_path_is_zero_copy() { let _media = media_lock(); let _worker = WorkerBinGuard::set(); - use oakrender::manager::{RenderBackendChoice, RenderManager}; - use oakrender::procpool::{ + use oak_render::manager::{RenderBackendChoice, RenderManager}; + use oak_render::procpool::{ main_heap_frame_copies, reset_main_heap_frame_copies, DispatcherConfig, }; RenderManager::shutdown(); @@ -5691,7 +5691,7 @@ mod tests { release_rendered_frame(&frame); RenderManager::shutdown(); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } /// M12 P3 acceptance: importing a media file makes it appear in the @@ -5706,7 +5706,7 @@ mod tests { "oakapp_browser_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10) + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10) .expect("generate test media"); graphops::import_footage(&project, &media).expect("import must succeed"); @@ -5726,7 +5726,7 @@ mod tests { let node = crate::oakui::projectbrowser::find_by_identity(&project, entry.id); assert!(node.is_some(), "selection resolves to a node"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -5748,7 +5748,7 @@ mod tests { "oakapp_engine_import_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10) + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10) .expect("generate e2e test media"); let imported = cx .update(|app| engine.update(app, |engine, cx| engine.import_footage(media.clone(), cx))); @@ -5954,7 +5954,7 @@ mod tests { let entries = cx.read(|app| engine.read(app).history_entries()); assert!(entries.iter().all(|e| e.done), "the redo restored every row"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } /// The multicam switch through the UI path (`multicam_switch_to`): it @@ -5966,7 +5966,7 @@ mod tests { async fn real_engine_multicam_switch_round_trips_through_undo( cx: &mut gpui::TestAppContext, ) { - use oaknode::block::clip_input::TEXTURE_INPUT; + use oak_node::block::clip_input::TEXTURE_INPUT; let _media = media_lock(); let engine = cx.update(|cx| cx.new(|cx| RealEngine::create(cx))); @@ -5977,7 +5977,7 @@ mod tests { let seq = graphops::create_sequence(&project, "Multicam Test"); graphops::add_track(&project, seq, TrackType::Video).unwrap(); graphops::add_track(&project, seq, TrackType::Video).unwrap(); - let clip = oaktimeline::util::block_clip_create(&project); + let clip = oak_timeline::util::block_clip_create(&project); { let mut g = graphops::lock(&project); let c = g @@ -5987,20 +5987,20 @@ mod tests { .behavior .as_any_mut() .unwrap() - .downcast_mut::() + .downcast_mut::() .unwrap(); - c.core.range = oakcore_rs::TimeRange::new( - oakcore_rs::Rational::new(0, 1), - oakcore_rs::Rational::new(100, 1), + c.core.range = oak_core::TimeRange::new( + oak_core::Rational::new(0, 1), + oak_core::Rational::new(100, 1), ); - c.core.media_in = oakcore_rs::Rational::new(0, 1); + c.core.media_in = oak_core::Rational::new(0, 1); } let track0 = { let g = graphops::lock(&project); graphops::track_ids(&g.graph, seq, TrackType::Video)[0] }; - oaktimeline::util::track_append_block( - &oaktimeline::util::NodeRef::new(project.clone(), track0), + oak_timeline::util::track_append_block( + &oak_timeline::util::NodeRef::new(project.clone(), track0), &clip, ); { @@ -6074,7 +6074,7 @@ mod tests { "disabling multicam clears the detection" ); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } /// M12 P2 acceptance: a real project with a sequence + footage clip @@ -6093,7 +6093,7 @@ mod tests { "oakapp_nodegraph_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10) + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10) .expect("generate test media"); let footage = graphops::import_footage(&project, &media).expect("import must succeed"); graphops::place_footage_clip(&project, seq, footage, TrackType::Video, 0, 0, 10, 0) @@ -6139,7 +6139,7 @@ mod tests { "the footage→clip media edge is real (got {real_edges} real edges)" ); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -6162,7 +6162,7 @@ mod tests { // (the effect-chain insert on an empty chain rewires nothing // and connects the effect to the clip's `tex_in`), then the // footage feeds the effect's media input. - let clip = oaktimeline::util::block_clip_create(&project); + let clip = oak_timeline::util::block_clip_create(&project); let ty = crate::oakui::effectchain::addable_effects() .into_iter() .next() @@ -6174,7 +6174,7 @@ mod tests { "oakapp_sel_link_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 32, 32, 10, 10) + oak_codec::testmedia::write_test_clip(&media, 32, 32, 10, 10) .expect("generate test media"); let footage = graphops::import_footage(&project, &media).expect("import the media"); let effect_input = graphops::lock(&project) @@ -6194,8 +6194,8 @@ mod tests { let g = graphops::lock(&project); graphops::track_ids(&g.graph, seq, TrackType::Video)[0] }; - oaktimeline::util::track_append_block( - &oaktimeline::util::NodeRef::new(project.clone(), track0), + oak_timeline::util::track_append_block( + &oak_timeline::util::NodeRef::new(project.clone(), track0), &clip, ); let _ = std::fs::remove_file(&media); @@ -6272,7 +6272,7 @@ mod tests { "a card click re-selects the effect's node" ); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); } /// Regression: the source monitor's full-res job renders the selected @@ -6293,7 +6293,7 @@ mod tests { "oakapp_fullres_src_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10) + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10) .expect("generate test media"); let footage = graphops::import_footage(&project, &media).expect("import must succeed"); let tb = graphops::sequence_time_base(&graphops::lock(&project).graph, seq).unwrap(); @@ -6322,7 +6322,7 @@ mod tests { .expect("the worker delivers the frame after the project drop"); let bytes = event.image.as_bytes(0).expect("one frame"); assert_eq!(bytes.len(), 64 * 64 * 4, "full-res geometry"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -6467,7 +6467,7 @@ mod tests { "oakapp_fullres_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10) + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10) .expect("generate test media"); let footage = graphops::import_footage(&project, &media).expect("import must succeed"); graphops::place_footage_clip(&project, seq, footage, TrackType::Video, 0, 0, 10, 0) @@ -6503,7 +6503,7 @@ mod tests { .count(); assert!(nonzero > 0, "the footage clip renders non-black pixels"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -6834,7 +6834,7 @@ mod tests { "oakapp_playback_window_{}.mp4", std::process::id() )); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 250, 25) + oak_codec::testmedia::write_test_clip(&media, 64, 64, 250, 25) .expect("generate playback test media"); cx.update(|app| { engine.update(app, |engine, cx| { diff --git a/src/oakui/renderops.rs b/crates/oak-app/src/oakui/renderops.rs similarity index 93% rename from src/oakui/renderops.rs rename to crates/oak-app/src/oakui/renderops.rs index 9f821f087..7817ddb2b 100644 --- a/src/oakui/renderops.rs +++ b/crates/oak-app/src/oakui/renderops.rs @@ -22,20 +22,20 @@ //! `oakengine_task_start_sync` + the task subscription) are app-side now: //! the montage builders read the oaknode graph directly and the renders //! go through the oakrender ticket arena, exactly like the CLI's -//! `engine.rs` (M14 R2). The export drives `oaktask::export::ExportTask` +//! `engine.rs` (M14 R2). The export drives `oak_task::export::ExportTask` //! synchronously on a background thread with the module task's event //! listener and cancel atom wired to the app's [`ExportSession`]. use std::sync::mpsc; use gpui::RenderImage; -use oakcore_rs::{Rational, TimeRange}; -use oaknode::id::NodeId; -use oaknode::track::TrackType; -use oakrender::manager::RenderManager; -use oakrender::procpool::ShmFrameRef; -use oakrender::texture::Texture; -use oakrender::ticket::{AudioTicketParams, MontageClip, TicketPayload, VideoTicketParams}; +use oak_core::{Rational, TimeRange}; +use oak_node::id::NodeId; +use oak_node::track::TrackType; +use oak_render::manager::RenderManager; +use oak_render::procpool::ShmFrameRef; +use oak_render::texture::Texture; +use oak_render::ticket::{AudioTicketParams, MontageClip, TicketPayload, VideoTicketParams}; use super::engine::{ExportEvent, ExportSession}; use super::frames::{bgra_bytes_to_render_image, f32_rgba_to_bgra_image}; @@ -44,14 +44,14 @@ use super::graphops::{ }; use super::scopes::{analyze_bgra8, analyze_f32_rgba, ScopeData}; -/// The pixel format the viewers render in (`oakcore_rs::PixelFormat::F32`, +/// The pixel format the viewers render in (`oak_core::PixelFormat::F32`, /// the pipeline's internal format; the app downconverts to BGRA itself). pub const PIXEL_FORMAT_F32: i32 = 4; /// The BGRA8 slot wire format the process backend renders into (M15 S2): /// the worker converts its F32 pipeline output to BGRA8 at the end of the /// render, so the main process reads display-ready bytes from the slot. -pub const SLOT_FORMAT_BGRA8: i32 = oakrender::ipc::SLOT_FORMAT_BGRA8; +pub const SLOT_FORMAT_BGRA8: i32 = oak_render::ipc::SLOT_FORMAT_BGRA8; // --------------------------------------------------------------------------- // Render manager @@ -79,7 +79,7 @@ pub fn ensure_render_manager() -> bool { /// `UseProxyMedia` config switch (C++ `Tools > Use Proxy Media`; the /// export path never consults it — exports always decode the original). pub fn use_proxy_media() -> bool { - oakcommon::configstore::ConfigStore::instance().get_bool(None, "UseProxyMedia", 1) != 0 + oak_common::configstore::ConfigStore::instance().get_bool(None, "UseProxyMedia", 1) != 0 } /// The preview media of a footage node with the three-level proxy switch @@ -91,7 +91,7 @@ pub fn use_proxy_media() -> bool { /// (the first source audio stream's rank + 1). A missing proxy file falls /// back to the original. pub fn preview_footage_media( - f: &oaknode::footage::FootageBehavior, + f: &oak_node::footage::FootageBehavior, is_video: bool, ) -> (String, i32) { // The original media decodes from the footage's actual first stream of @@ -107,8 +107,8 @@ pub fn preview_footage_media( if !use_proxy_media() || !f.proxy_enabled || f.proxy.is_empty() { return original; } - if oakcodec::proxymanager::ProxyManager::get_proxy_state(&f.proxy) - != oakcodec::proxymanager::ProxyState::Ready + if oak_codec::proxymanager::ProxyManager::get_proxy_state(&f.proxy) + != oak_codec::proxymanager::ProxyState::Ready { return original; } @@ -120,7 +120,7 @@ pub fn preview_footage_media( Some(stream) if f.proxy_video_stream_index == stream.index => (f.proxy.clone(), 0), _ => original, } - } else if oakcodec::proxymanager::ProxyManager::proxy_filename_has_audio(&f.proxy) { + } else if oak_codec::proxymanager::ProxyManager::proxy_filename_has_audio(&f.proxy) { (f.proxy.clone(), 1) } else { original @@ -130,7 +130,7 @@ pub fn preview_footage_media( /// The preview media feeding a clip: the clip's footage with the proxy /// switch applied ([`preview_footage_media`]). fn clip_preview_media( - g: &oaknode::graph::Graph, + g: &oak_node::graph::Graph, block_id: NodeId, is_video: bool, ) -> Option<(String, i32)> { @@ -743,14 +743,14 @@ pub fn encoding_params( path: &std::path::Path, workarea: Option<(i64, i64)>, length_frames: i64, -) -> Result { - let container = oakcodec::exportformat::Format::from_i32(format) +) -> Result { + let container = oak_codec::exportformat::Format::from_i32(format) .ok_or_else(|| format!("unknown export format {format}"))?; - let video_codec = oakcodec::exportformat::Format::get_video_codecs(container) + let video_codec = oak_codec::exportformat::Format::get_video_codecs(container) .first() .copied() .ok_or_else(|| format!("format {format} has no video codec"))?; - let audio_codec = oakcodec::exportformat::Format::get_audio_codecs(container) + let audio_codec = oak_codec::exportformat::Format::get_audio_codecs(container) .first() .copied() .ok_or_else(|| format!("format {format} has no audio codec"))?; @@ -780,7 +780,7 @@ pub fn encoding_params( Rational::new(length_frames.max(0) * i64::from(rate_den), i64::from(rate_num)), ), }; - Ok(oaktask::export::EncodingParams { + Ok(oak_task::export::EncodingParams { filename: path.to_string_lossy().into_owned(), format, video_enabled: true, @@ -812,24 +812,24 @@ pub fn encoding_params( pub fn spawn_export( p: &ProjectRef, seq: NodeId, - params: oaktask::export::EncodingParams, + params: oak_task::export::EncodingParams, ) -> ExportSession { let (tx, rx) = mpsc::channel::(); - let mut driver = oaktask::task::Task::new("Exporting...", None); + let mut driver = oak_task::task::Task::new("Exporting...", None); let cancel_atom = driver.get_cancel_atom(); { let tx = tx.clone(); driver.set_event_listener(Box::new(move |event| { let event = match event { - oaktask::task::TaskEvent::Started => ExportEvent::Started, - oaktask::task::TaskEvent::Progress(value) => ExportEvent::Progress(value), + oak_task::task::TaskEvent::Started => ExportEvent::Started, + oak_task::task::TaskEvent::Progress(value) => ExportEvent::Progress(value), // Finished is reported by the worker below (with the error). - oaktask::task::TaskEvent::Finished => return, + oak_task::task::TaskEvent::Finished => return, }; let _ = tx.send(event); })); } - driver.set_behavior(Box::new(oaktask::export::ExportTask::new( + driver.set_behavior(Box::new(oak_task::export::ExportTask::new( (p.clone(), seq), params, ))); @@ -879,7 +879,7 @@ mod tests { fn video_montage_covers_the_clip_range() { let _media = media_lock(); let media = std::env::temp_dir().join(format!("oakapp_montage_{}.mp4", std::process::id())); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); let (project, seq, _) = project_with_clip(&media); let tb = graphops::sequence_time_base(&lock(&project).graph, seq).unwrap(); @@ -897,7 +897,7 @@ mod tests { video_montage(&project, seq, at(-1)).is_empty(), "a negative time covers nothing" ); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -907,22 +907,22 @@ mod tests { /// the proxy switch is off or the proxy is not ready. #[test] fn preview_media_uses_the_probed_stream_indices() { - let stream = |index: i32, is_video: bool| oaknode::footage::StreamInfo { + let stream = |index: i32, is_video: bool| oak_node::footage::StreamInfo { index, is_video, video: None, audio: None, - duration: oakcore_rs::Rational::new(0, 1), + duration: oak_core::Rational::new(0, 1), }; // An audio-first container: audio at 0, video at 1… plus a second // audio track at 2. The video must come from stream 1 and the audio // from stream 0, not the legacy 0/1 assumption. - let mut f = oaknode::footage::FootageBehavior::new("/tmp/audio-first.mov"); + let mut f = oak_node::footage::FootageBehavior::new("/tmp/audio-first.mov"); f.streams = vec![stream(0, false), stream(1, true), stream(2, false)]; assert_eq!(preview_footage_media(&f, true).1, 1); assert_eq!(preview_footage_media(&f, false).1, 0); // Unprobed footage (no stream metadata) keeps the 0/1 fallbacks. - let unprobed = oaknode::footage::FootageBehavior::new("/tmp/legacy.mov"); + let unprobed = oak_node::footage::FootageBehavior::new("/tmp/legacy.mov"); assert_eq!(preview_footage_media(&unprobed, true).1, 0); assert_eq!(preview_footage_media(&unprobed, false).1, 1); } @@ -936,7 +936,7 @@ mod tests { let _media = media_lock(); let media = std::env::temp_dir().join(format!("oakapp_montage_ang_{}.mp4", std::process::id())); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); let (project, seq, footage) = project_with_clip(&media); graphops::add_track(&project, seq, TrackType::Video).expect("add a second video track"); @@ -974,7 +974,7 @@ mod tests { "the other track is unaffected" ); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -982,7 +982,7 @@ mod tests { fn audio_montage_overlaps_the_range() { let _media = media_lock(); let media = std::env::temp_dir().join(format!("oakapp_montage_a_{}.mp4", std::process::id())); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); let (project, seq, footage) = project_with_clip(&media); graphops::add_track(&project, seq, TrackType::Audio).expect("add an audio track"); @@ -996,7 +996,7 @@ mod tests { assert_eq!(overlapping[0].stream_index, 1, "the audio stream is selected"); let disjoint = audio_montage(&project, seq, TimeRange::new(at(10), at(20))); assert!(disjoint.is_empty(), "a range past the clip overlaps nothing"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } @@ -1007,7 +1007,7 @@ mod tests { fn montages_skip_muted_tracks() { let _media = media_lock(); let media = std::env::temp_dir().join(format!("oakapp_montage_m_{}.mp4", std::process::id())); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); let (project, seq, footage) = project_with_clip(&media); graphops::add_track(&project, seq, TrackType::Audio).expect("add an audio track"); @@ -1037,11 +1037,11 @@ mod tests { "a muted audio track contributes nothing" ); - oakundo::global::undo().unwrap(); - oakundo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); + oak_undo::global::undo().unwrap(); assert_eq!(video_montage(&project, seq, at(0)).len(), 1, "undo restores the video clip"); assert_eq!(audio_montage(&project, seq, range).len(), 1, "undo restores the audio clip"); - oakundo::global::clear().unwrap(); + oak_undo::global::clear().unwrap(); let _ = std::fs::remove_file(&media); } } diff --git a/src/oakui/scopes.rs b/crates/oak-app/src/oakui/scopes.rs similarity index 100% rename from src/oakui/scopes.rs rename to crates/oak-app/src/oakui/scopes.rs diff --git a/src/oakui/timecode.rs b/crates/oak-app/src/oakui/timecode.rs similarity index 100% rename from src/oakui/timecode.rs rename to crates/oak-app/src/oakui/timecode.rs diff --git a/src/oakui/transport.rs b/crates/oak-app/src/oakui/transport.rs similarity index 100% rename from src/oakui/transport.rs rename to crates/oak-app/src/oakui/transport.rs diff --git a/src/oakui/waveform.rs b/crates/oak-app/src/oakui/waveform.rs similarity index 97% rename from src/oakui/waveform.rs rename to crates/oak-app/src/oakui/waveform.rs index 9df24c7f5..a3f955359 100644 --- a/src/oakui/waveform.rs +++ b/crates/oak-app/src/oakui/waveform.rs @@ -17,7 +17,7 @@ //! M12 P4: timeline audio waveforms. //! //! The [`WaveformCache`] holds per-clip min/max peak data extracted -//! through `oakaudio::waveform::extract` (the real FFmpeg-backed +//! through `oak_audio::waveform::extract` (the real FFmpeg-backed //! extraction; M14 R3: a direct module call, no facade); the engine //! refreshes it when the timeline rebuilds. The [`OakClipDecorator`] draws //! the peaks into the timeline's clip body. @@ -106,7 +106,7 @@ impl WaveformCache { let cname = std::ffi::CString::new(filename).ok()?; const SAMPLES_PER_POINT: i32 = 256; // Audio-stream index 0 (probe numbering). - let outcome = oakaudio::waveform::extract(&cname, 0, SAMPLES_PER_POINT).ok()?; + let outcome = oak_audio::waveform::extract(&cname, 0, SAMPLES_PER_POINT).ok()?; if outcome.channels <= 0 || outcome.points.is_empty() { return None; } diff --git a/src/oakui/waveformsync.rs b/crates/oak-app/src/oakui/waveformsync.rs similarity index 98% rename from src/oakui/waveformsync.rs rename to crates/oak-app/src/oakui/waveformsync.rs index b209bfa2b..ee1cbfe32 100644 --- a/src/oakui/waveformsync.rs +++ b/crates/oak-app/src/oakui/waveformsync.rs @@ -15,7 +15,7 @@ // along with this program. If not, see . //! Windowed peak envelopes over the cached clip waveforms, the input of -//! `oakaudio::waveformsync`'s offset / stretch correlation (the app-side +//! `oak_audio::waveformsync`'s offset / stretch correlation (the app-side //! mirror of the C++ `extract_waveform_cache_envelope` in //! `timelinewidgetwaveformsync.cpp`). //! diff --git a/src/panels/commands.rs b/crates/oak-app/src/panels/commands.rs similarity index 100% rename from src/panels/commands.rs rename to crates/oak-app/src/panels/commands.rs diff --git a/src/panels/effect_library.rs b/crates/oak-app/src/panels/effect_library.rs similarity index 100% rename from src/panels/effect_library.rs rename to crates/oak-app/src/panels/effect_library.rs diff --git a/src/panels/history.rs b/crates/oak-app/src/panels/history.rs similarity index 100% rename from src/panels/history.rs rename to crates/oak-app/src/panels/history.rs diff --git a/src/panels/inspector.rs b/crates/oak-app/src/panels/inspector.rs similarity index 100% rename from src/panels/inspector.rs rename to crates/oak-app/src/panels/inspector.rs diff --git a/src/panels/mod.rs b/crates/oak-app/src/panels/mod.rs similarity index 100% rename from src/panels/mod.rs rename to crates/oak-app/src/panels/mod.rs diff --git a/src/panels/multicam.rs b/crates/oak-app/src/panels/multicam.rs similarity index 99% rename from src/panels/multicam.rs rename to crates/oak-app/src/panels/multicam.rs index 5053bad4c..0f287daf8 100644 --- a/src/panels/multicam.rs +++ b/crates/oak-app/src/panels/multicam.rs @@ -36,7 +36,7 @@ //! //! Switch requests during playback are queued (the C++ `play_queue_` //! semantics) and applied when the program playhead reaches the target -//! time. Every switch goes through `oaktimeline::multicam::multicam_switch` +//! time. Every switch goes through `oak_timeline::multicam::multicam_switch` //! on the global undo stack. use std::collections::{HashMap, VecDeque}; @@ -50,7 +50,7 @@ use gpui::{ }; use gpui_widgets::viewer::PlaybackClock; -use oaknode::nodes::multicamnode::MultiCamNode; +use oak_node::nodes::multicamnode::MultiCamNode; use crate::oakui::timecode::format_timecode; use crate::oakui::{AppEngine, MulticamState}; diff --git a/src/panels/node_editor.rs b/crates/oak-app/src/panels/node_editor.rs similarity index 100% rename from src/panels/node_editor.rs rename to crates/oak-app/src/panels/node_editor.rs diff --git a/src/panels/ofx_params.rs b/crates/oak-app/src/panels/ofx_params.rs similarity index 98% rename from src/panels/ofx_params.rs rename to crates/oak-app/src/panels/ofx_params.rs index 8247f7a5f..ac8c81822 100644 --- a/src/panels/ofx_params.rs +++ b/crates/oak-app/src/panels/ofx_params.rs @@ -61,7 +61,7 @@ use gpui_widgets::slider::{Slider, SliderEvent, SliderModel}; use gpui_widgets::spinbox::{SpinBox, SpinBoxEvent}; use gpui_widgets::value::{SliderValue, ValueKind}; -use oaknode::value::{NodeValue, ValueType}; +use oak_node::value::{NodeValue, ValueType}; use crate::oakui::{AppEngine, EffectParam}; @@ -211,7 +211,7 @@ impl OfxParamsView { // an identical curve (sync_values runs per render). let curves = match ¶m.value { NodeValue::Text(json) => { - oakplugin::param_curve::curves_from_json(json).unwrap_or_default() + oak_plugin::param_curve::curves_from_json(json).unwrap_or_default() } _ => Vec::new(), }; @@ -244,10 +244,10 @@ impl OfxParamsView { /// (LUT-style params), else the data extent with a 10% pad. fn curve_domain( param: &EffectParam, - curves: &[oakplugin::param_curve::Curve], + curves: &[oak_plugin::param_curve::Curve], ) -> (f64, f64, f64, f64) { let (mut lo, mut hi) = (0.0, 1.0); - if let Some((_, oaknode::value::NodeValue::Vec2(v))) = param + if let Some((_, oak_node::value::NodeValue::Vec2(v))) = param .properties .iter() .find(|(k, _)| k == "parametric_range") @@ -288,8 +288,8 @@ fn curve_domain( /// handle offsets; a point without an explicit slope edits gets linear /// handles). fn curve_point_to_editor( - p: &oakplugin::param_curve::ControlPoint, - points: &[oakplugin::param_curve::ControlPoint], + p: &oak_plugin::param_curve::ControlPoint, + points: &[oak_plugin::param_curve::ControlPoint], domain: (f64, f64, f64, f64), ) -> gpui_widgets::curve_editor::CurvePoint { use gpui_widgets::curve_editor::{CurvePoint, CurveVec2}; @@ -322,11 +322,11 @@ fn curve_point_to_editor( fn curve_from_editor( points: &[gpui_widgets::curve_editor::CurvePoint], domain: (f64, f64, f64, f64), -) -> oakplugin::param_curve::Curve { +) -> oak_plugin::param_curve::Curve { let (lo, hi, vmin, vmax) = domain; let (sx, sy) = (hi - lo, vmax - vmin); let n = points.len(); - let mut out = oakplugin::param_curve::Curve::empty(); + let mut out = oak_plugin::param_curve::Curve::empty(); for (i, p) in points.iter().enumerate() { let key = lo + p.x * sx; let value = vmin + p.y * sy; @@ -373,7 +373,7 @@ fn curve_from_editor( _ => 0.0, } }); - out.points.push(oakplugin::param_curve::ControlPoint { + out.points.push(oak_plugin::param_curve::ControlPoint { key, value, slope: m_norm * sy / sx, @@ -600,7 +600,7 @@ fn build_control( // One curve editor per dimension; points are seeded from the // JSON mirror of the curves (the input's Text value). let curves = match ¶m.value { - NodeValue::Text(json) => oakplugin::param_curve::curves_from_json(json) + NodeValue::Text(json) => oak_plugin::param_curve::curves_from_json(json) .unwrap_or_default(), _ => Vec::new(), }; @@ -779,14 +779,14 @@ fn wire_controls(view: &OfxParamsView, cx: &mut Context {} _ => return, } - let curves: Vec = editors_all + let curves: Vec = editors_all .iter() .map(|e| { let points = e.read(cx).points().to_vec(); curve_from_editor(&points, domain) }) .collect(); - let json = oakplugin::param_curve::curves_to_json(&curves); + let json = oak_plugin::param_curve::curves_to_json(&curves); engine.update(cx, |engine, cx| { let _ = engine.set_effect_param( effect, diff --git a/src/panels/program_viewer.rs b/crates/oak-app/src/panels/program_viewer.rs similarity index 100% rename from src/panels/program_viewer.rs rename to crates/oak-app/src/panels/program_viewer.rs diff --git a/src/panels/project_explorer.rs b/crates/oak-app/src/panels/project_explorer.rs similarity index 100% rename from src/panels/project_explorer.rs rename to crates/oak-app/src/panels/project_explorer.rs diff --git a/src/panels/source_viewer.rs b/crates/oak-app/src/panels/source_viewer.rs similarity index 100% rename from src/panels/source_viewer.rs rename to crates/oak-app/src/panels/source_viewer.rs diff --git a/src/panels/status_bar.rs b/crates/oak-app/src/panels/status_bar.rs similarity index 100% rename from src/panels/status_bar.rs rename to crates/oak-app/src/panels/status_bar.rs diff --git a/src/panels/timeline.rs b/crates/oak-app/src/panels/timeline.rs similarity index 100% rename from src/panels/timeline.rs rename to crates/oak-app/src/panels/timeline.rs diff --git a/tests/demo.mp4 b/crates/oak-app/tests/demo.mp4 similarity index 100% rename from tests/demo.mp4 rename to crates/oak-app/tests/demo.mp4 diff --git a/tests/img.png b/crates/oak-app/tests/img.png similarity index 100% rename from tests/img.png rename to crates/oak-app/tests/img.png diff --git a/tests/project_with_footage.ove b/crates/oak-app/tests/project_with_footage.ove similarity index 100% rename from tests/project_with_footage.ove rename to crates/oak-app/tests/project_with_footage.ove diff --git a/tests/waveform_e2e.rs b/crates/oak-app/tests/waveform_e2e.rs similarity index 90% rename from tests/waveform_e2e.rs rename to crates/oak-app/tests/waveform_e2e.rs index 64fe9b692..9d1672936 100644 --- a/tests/waveform_e2e.rs +++ b/crates/oak-app/tests/waveform_e2e.rs @@ -21,7 +21,7 @@ //! decode + an audio decode in one process crashes at exit, so the //! waveform test stays isolated from the in-lib media tests. //! -//! M14 R3: the extraction is a direct `oakaudio::waveform::extract` call +//! M14 R3: the extraction is a direct `oak_audio::waveform::extract` call //! (no facade). use oakapp::oakui::waveform::{MinMax, WaveformCache}; @@ -29,7 +29,7 @@ use oakapp::oakui::waveform::{MinMax, WaveformCache}; #[test] fn waveform_extract_and_cache_hit() { let media = std::env::temp_dir().join(format!("oakapp_waveform_{}.mp4", std::process::id())); - oakcodec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); + oak_codec::testmedia::write_test_clip(&media, 64, 64, 10, 10).expect("generate test media"); let filename = media.to_string_lossy().into_owned(); let cache = WaveformCache::new(25.0); cache.refresh(7, &filename, 250); @@ -54,7 +54,7 @@ fn waveform_extract_and_cache_hit() { fn minmax_layout_is_two_f32s() { assert_eq!(std::mem::size_of::(), 8); assert_eq!( - std::mem::size_of::(), + std::mem::size_of::(), 8 ); } diff --git a/crates/oakaudio/COVERAGE.md b/crates/oak-audio/COVERAGE.md similarity index 100% rename from crates/oakaudio/COVERAGE.md rename to crates/oak-audio/COVERAGE.md diff --git a/crates/oakaudio/Cargo.lock b/crates/oak-audio/Cargo.lock similarity index 100% rename from crates/oakaudio/Cargo.lock rename to crates/oak-audio/Cargo.lock diff --git a/crates/oakaudio/Cargo.toml b/crates/oak-audio/Cargo.toml similarity index 74% rename from crates/oakaudio/Cargo.toml rename to crates/oak-audio/Cargo.toml index 9e67a739c..fc6e3073c 100644 --- a/crates/oakaudio/Cargo.toml +++ b/crates/oak-audio/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakaudio" -version = "0.1.0" +name = "oak-audio" +version.workspace = true edition = "2021" description = "Oak Video Editor audio I/O, processing, synchronization and waveform engine (Rust)" license = "GPL-3.0-or-later" @@ -9,13 +9,13 @@ license = "GPL-3.0-or-later" crate-type = ["staticlib", "rlib"] [dependencies] -oakffmpeg-link = { path = "../oakffmpeg-link" } -oakcore-rs = { path = "../oakcore" } -oakcommon = { path = "../oakcommon" } -oakcodec = { path = "../oakcodec" } +oak-ffmpeg-link = { path = "../oak-ffmpeg-link" } +oak-core = { path = "../oak-core" } +oak-common = { path = "../oak-common" } +oak-codec = { path = "../oak-codec" } # Real resample/channel-convert/time-stretch filter graph. The C++ # ffmpeg_bridge library existed only to absorb FFmpeg API churn; the Rust -# crate calls ffmpeg-next directly (same as oakcodec). The oakffmpeg-link +# crate calls ffmpeg-next directly (same as oakcodec). The oak-ffmpeg-link # dependency above emits the transitive link flags of the static FFmpeg. ffmpeg-next = "9" diff --git a/crates/oakaudio/README.md b/crates/oak-audio/README.md similarity index 100% rename from crates/oakaudio/README.md rename to crates/oak-audio/README.md diff --git a/crates/oakaudio/src/config.rs b/crates/oak-audio/src/config.rs similarity index 98% rename from crates/oakaudio/src/config.rs rename to crates/oak-audio/src/config.rs index d2f9d7799..d03fa9502 100644 --- a/crates/oakaudio/src/config.rs +++ b/crates/oak-audio/src/config.rs @@ -20,7 +20,7 @@ use std::error::Error; use std::ffi::CString; use std::str::FromStr; -use oakcommon::configstore::*; +use oak_common::configstore::*; /// PortAudio output buffer size in frames; 0 = let PortAudio choose. /// /// `// CPP-PARITY: src/audio/src/configbridge.cpp:30` diff --git a/crates/oakaudio/src/error.rs b/crates/oak-audio/src/error.rs similarity index 100% rename from crates/oakaudio/src/error.rs rename to crates/oak-audio/src/error.rs diff --git a/crates/oakaudio/src/levelmeter.rs b/crates/oak-audio/src/levelmeter.rs similarity index 100% rename from crates/oakaudio/src/levelmeter.rs rename to crates/oak-audio/src/levelmeter.rs diff --git a/crates/oakaudio/src/lib.rs b/crates/oak-audio/src/lib.rs similarity index 96% rename from crates/oakaudio/src/lib.rs rename to crates/oak-audio/src/lib.rs index f92ae7cc6..220ba7254 100644 --- a/crates/oakaudio/src/lib.rs +++ b/crates/oak-audio/src/lib.rs @@ -46,4 +46,4 @@ pub mod waveformsync; // link flags (the static FFmpeg's transitive dependencies) reach the // final link — rustc prunes the flags of an unreferenced rlib. #[used] -static FORCE_FFMPEG_LINK: fn() = oakffmpeg_link::force_link; +static FORCE_FFMPEG_LINK: fn() = oak_ffmpeg_link::force_link; diff --git a/crates/oakaudio/src/manager.rs b/crates/oak-audio/src/manager.rs similarity index 99% rename from crates/oakaudio/src/manager.rs rename to crates/oak-audio/src/manager.rs index 1191a20ec..b46ab3e57 100644 --- a/crates/oakaudio/src/manager.rs +++ b/crates/oak-audio/src/manager.rs @@ -29,8 +29,8 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, MutexGuard, OnceLock}; use cpal::{Device, DeviceId}; use cpal::traits::{DeviceTrait, HostTrait}; -use oakcodec::encoder::Encoder; -use oakcodec::encodingparams::EncodingParams; +use oak_codec::encoder::Encoder; +use oak_codec::encodingparams::EncodingParams; use crate::error::{Error, Result}; use crate::params::AudioParams; use crate::previewdevice::PreviewAudioDevice; @@ -290,7 +290,7 @@ impl ManagerInner { if self.input_device == PA_NO_DEVICE { return Err(Box::new(Error::Failed("no input device".to_string()))); } - let encoder = oakcodec::encoder::create_from_params(params) + let encoder = oak_codec::encoder::create_from_params(params) .ok_or_else(|| Error::Failed("failed to create encoder for recording".to_string()))?; encoder .configure(params) diff --git a/crates/oakaudio/src/outputdevice.rs b/crates/oak-audio/src/outputdevice.rs similarity index 100% rename from crates/oakaudio/src/outputdevice.rs rename to crates/oak-audio/src/outputdevice.rs diff --git a/crates/oakaudio/src/params.rs b/crates/oak-audio/src/params.rs similarity index 98% rename from crates/oakaudio/src/params.rs rename to crates/oak-audio/src/params.rs index 6e9c9253a..0b480b4f0 100644 --- a/crates/oakaudio/src/params.rs +++ b/crates/oak-audio/src/params.rs @@ -22,12 +22,12 @@ //! These integer values cross the C ABI as `int`, so they MUST match the //! authoritative C++ enums bit-for-bit. -use oakcore_rs::Rational; +use oak_core::Rational; /// Audio sample format: re-exported from oakcore-rs (planar-first, /// values identical to `olive::core::SampleFormat::Format`). /// `// CPP-PARITY: core/include/olive/core/render/sampleformat.h:33` -pub use oakcore_rs::SampleFormat; +pub use oak_core::SampleFormat; /// Audio stream parameters, mirroring `olive::core::AudioParams` /// (core/include/olive/core/render/audioparams.h). A plain value type; diff --git a/crates/oakaudio/src/previewdevice.rs b/crates/oak-audio/src/previewdevice.rs similarity index 100% rename from crates/oakaudio/src/previewdevice.rs rename to crates/oak-audio/src/previewdevice.rs diff --git a/crates/oakaudio/src/processor.rs b/crates/oak-audio/src/processor.rs similarity index 100% rename from crates/oakaudio/src/processor.rs rename to crates/oak-audio/src/processor.rs diff --git a/crates/oakaudio/src/synchronizer.rs b/crates/oak-audio/src/synchronizer.rs similarity index 99% rename from crates/oakaudio/src/synchronizer.rs rename to crates/oak-audio/src/synchronizer.rs index 64438da44..e90359761 100644 --- a/crates/oakaudio/src/synchronizer.rs +++ b/crates/oak-audio/src/synchronizer.rs @@ -18,7 +18,7 @@ //! C++; becomes a plain function module. Times are `core::Rational` (from //! oakcore-rs). -use oakcore_rs::Rational; +use oak_core::Rational; use crate::params::rational_from_double; diff --git a/crates/oakaudio/src/waveform.rs b/crates/oak-audio/src/waveform.rs similarity index 99% rename from crates/oakaudio/src/waveform.rs rename to crates/oak-audio/src/waveform.rs index ec29a467d..281fa0b44 100644 --- a/crates/oakaudio/src/waveform.rs +++ b/crates/oak-audio/src/waveform.rs @@ -23,10 +23,10 @@ use std::collections::BTreeMap; use std::ffi::CStr; -use oakcodec::decoder::{receive_list_of_all_decoders, CodecStream, Decoder as _, RetrieveAudioStatus}; -use oakcodec::ffmpeg::FFmpegDecoder; -use oakcodec::footagedescription::FootageDescription; -use oakcore_rs::{Rational, TimeRange}; +use oak_codec::decoder::{receive_list_of_all_decoders, CodecStream, Decoder as _, RetrieveAudioStatus}; +use oak_codec::ffmpeg::FFmpegDecoder; +use oak_codec::footagedescription::FootageDescription; +use oak_core::{Rational, TimeRange}; use crate::error::{Error, Result}; diff --git a/crates/oakaudio/src/waveformsync.rs b/crates/oak-audio/src/waveformsync.rs similarity index 100% rename from crates/oakaudio/src/waveformsync.rs rename to crates/oak-audio/src/waveformsync.rs diff --git a/crates/oakaudio/tests/common/mod.rs b/crates/oak-audio/tests/common/mod.rs similarity index 100% rename from crates/oakaudio/tests/common/mod.rs rename to crates/oak-audio/tests/common/mod.rs diff --git a/crates/oakaudio/tests/golden_test.rs b/crates/oak-audio/tests/golden_test.rs similarity index 92% rename from crates/oakaudio/tests/golden_test.rs rename to crates/oak-audio/tests/golden_test.rs index 46d333403..5bcf3b572 100644 --- a/crates/oakaudio/tests/golden_test.rs +++ b/crates/oak-audio/tests/golden_test.rs @@ -22,9 +22,9 @@ mod common; use std::ffi::CString; use common::write_wav_header_only; -use oakcore_rs::Rational; -use oakaudio::params::{frames_to_rational, rational_to_samples, AudioParams, SampleFormat}; -use oakaudio::waveform::{extract, AudioVisualWaveform}; +use oak_core::Rational; +use oak_audio::params::{frames_to_rational, rational_to_samples, AudioParams, SampleFormat}; +use oak_audio::waveform::{extract, AudioVisualWaveform}; /// SampleFormat planar-first ordering matches the authoritative C++ enum: /// f32_p == 4 == OAKAUDIO_PROCESSOR_OUTPUT_FORMAT. This guards the @@ -32,7 +32,7 @@ use oakaudio::waveform::{extract, AudioVisualWaveform}; #[test] fn sample_format_planar_first_ordering() { assert_eq!(SampleFormat::F32Planar as i32, 4); - assert_eq!(oakaudio::processor::OUTPUT_FORMAT as i32, 4); + assert_eq!(oak_audio::processor::OUTPUT_FORMAT as i32, 4); // Invalid is -1 and the packed family follows planar-first. assert_eq!(SampleFormat::Invalid as i32, -1); assert_eq!(SampleFormat::U8Planar as i32, 0); @@ -57,7 +57,7 @@ fn sample_time_conversion_roundtrip() { /// rational conversion edge cases (NaN / out-of-range / tiny -> null). #[test] fn params_value_types() { - use oakaudio::params::rational_from_double; + use oak_audio::params::rational_from_double; let p = AudioParams { sample_rate: 48000, @@ -136,14 +136,14 @@ fn waveform_mipmap_scale_parity() { fn levelmeter_db_golden() { let tone = common::planar_from(&[0.5f32; 64], 1); let refs: Vec<&[f32]> = tone.iter().map(|v| v.as_slice()).collect(); - let stats = oakaudio::levelmeter::analyze_sample_buffer(&refs); + let stats = oak_audio::levelmeter::analyze_sample_buffer(&refs); let expected_db = 20.0 * 0.5f64.log10(); assert!((stats.channels[0].peak_db - expected_db).abs() < 1e-9); assert!((stats.channels[0].rms_db - expected_db).abs() < 1e-9); let silence = common::silence_planar(1, 64); let refs: Vec<&[f32]> = silence.iter().map(|v| v.as_slice()).collect(); - let stats = oakaudio::levelmeter::analyze_sample_buffer(&refs); + let stats = oak_audio::levelmeter::analyze_sample_buffer(&refs); assert_eq!(stats.channels[0].peak_db, -200.0); assert_eq!(stats.channels[0].rms_db, -200.0); assert_eq!(stats.channels[0].vu_db, -200.0); @@ -157,7 +157,7 @@ fn waveform_sync_offset_golden() { let reference: Vec = (0..10).map(|i| i as f64 * 0.1 + 0.1).collect(); let mut candidate = vec![0.0f64; 10]; candidate[2..].copy_from_slice(&reference[..8]); - let out = oakaudio::waveformsync::estimate_envelope_offset(&reference, &candidate, 100, 10); + let out = oak_audio::waveformsync::estimate_envelope_offset(&reference, &candidate, 100, 10); assert!(out.valid); assert_eq!(out.offset_samples, 200); assert!((out.confidence - 1.0).abs() < 1e-9); diff --git a/crates/oakaudio/tests/levelmeter_test.rs b/crates/oak-audio/tests/levelmeter_test.rs similarity index 98% rename from crates/oakaudio/tests/levelmeter_test.rs rename to crates/oak-audio/tests/levelmeter_test.rs index c5eaf14f5..8b54757f2 100644 --- a/crates/oakaudio/tests/levelmeter_test.rs +++ b/crates/oak-audio/tests/levelmeter_test.rs @@ -19,7 +19,7 @@ mod common; -use oakaudio::levelmeter::{analyze_sample_buffer, Stats}; +use oak_audio::levelmeter::{analyze_sample_buffer, Stats}; fn analyze(planes: &[Vec]) -> Stats { let refs: Vec<&[f32]> = planes.iter().map(Vec::as_slice).collect(); diff --git a/crates/oakaudio/tests/manager_test.rs b/crates/oak-audio/tests/manager_test.rs similarity index 90% rename from crates/oakaudio/tests/manager_test.rs rename to crates/oak-audio/tests/manager_test.rs index b6438af58..b196f8517 100644 --- a/crates/oakaudio/tests/manager_test.rs +++ b/crates/oak-audio/tests/manager_test.rs @@ -21,10 +21,10 @@ mod common; use common::lock_manager; -use oakcodec::encodingparams::EncodingParams; -use oakaudio::error::{Error, OAKAUDIO_E_INVALID}; -use oakaudio::manager::instance; -use oakaudio::params::{AudioParams, SampleFormat}; +use oak_codec::encodingparams::EncodingParams; +use oak_audio::error::{Error, OAKAUDIO_E_INVALID}; +use oak_audio::manager::instance; +use oak_audio::params::{AudioParams, SampleFormat}; /// Audio params for the tests: stereo f32 at 48 kHz. fn stereo() -> AudioParams { @@ -55,15 +55,15 @@ fn wav_params(filename: &str) -> EncodingParams { #[test] fn singleton_lifecycle() { let _guard = lock_manager(); - oakaudio::manager::ManagerInner::destroy_instance(); + oak_audio::manager::ManagerInner::destroy_instance(); assert!(instance().is_none()); - oakaudio::manager::ManagerInner::create_instance().unwrap(); + oak_audio::manager::ManagerInner::create_instance().unwrap(); assert!(instance().is_some()); - oakaudio::manager::ManagerInner::destroy_instance(); + oak_audio::manager::ManagerInner::destroy_instance(); assert!(instance().is_none()); - oakaudio::manager::ManagerInner::create_instance().unwrap(); + oak_audio::manager::ManagerInner::create_instance().unwrap(); assert!(instance().is_some()); } @@ -71,8 +71,8 @@ fn singleton_lifecycle() { /// (`output_started`, buffered params) that earlier tests in this binary /// may have left behind. fn fresh_instance() { - oakaudio::manager::ManagerInner::destroy_instance(); - oakaudio::manager::ManagerInner::create_instance().unwrap(); + oak_audio::manager::ManagerInner::destroy_instance(); + oak_audio::manager::ManagerInner::create_instance().unwrap(); } /// push_to_output accepts raw interleaved bytes and starts the virtual @@ -142,7 +142,7 @@ fn output_control_flags() { m.set_output_notify_interval(1024).unwrap(); let err = m.set_output_notify_interval(-1).unwrap_err(); assert_eq!( - err.downcast_ref::().map(|e| e.code()), + err.downcast_ref::().map(|e| e.code()), Some(OAKAUDIO_E_INVALID) ); m.clear_buffered_output().unwrap(); @@ -192,15 +192,15 @@ fn recording_start_stop() { /// falls back to 0 and device names are absent. #[test] fn config_defaults() { - assert_eq!(oakaudio::config::output_buffer_size(), 0); - assert!(oakaudio::config::device_name(true).is_err(), "no configured output device"); - assert!(oakaudio::config::device_name(false).is_err(), "no configured input device"); + assert_eq!(oak_audio::config::output_buffer_size(), 0); + assert!(oak_audio::config::device_name(true).is_err(), "no configured output device"); + assert!(oak_audio::config::device_name(false).is_err(), "no configured input device"); } /// PreviewAudioDevice pull-side plumbing (read/notify callback/clock). #[test] fn preview_device_pull_side() { - use oakaudio::previewdevice::PreviewAudioDevice; + use oak_audio::previewdevice::PreviewAudioDevice; let mut dev = PreviewAudioDevice::new(); dev.set_params(AudioParams { @@ -288,7 +288,7 @@ fn output_levels_reports_buffered_peaks() { // The error mapping is intact. assert_eq!(Error::Invalid.code(), OAKAUDIO_E_INVALID); - assert_eq!(Error::Failed("x".to_string()).code(), oakaudio::error::OAKAUDIO_E_FAILED); + assert_eq!(Error::Failed("x".to_string()).code(), oak_audio::error::OAKAUDIO_E_FAILED); // Leave the singleton as we found it: the push flipped // `output_started`, which other tests' seconds() assertions depend on. diff --git a/crates/oakaudio/tests/processor_test.rs b/crates/oak-audio/tests/processor_test.rs similarity index 96% rename from crates/oakaudio/tests/processor_test.rs rename to crates/oak-audio/tests/processor_test.rs index 08b8894f0..c0c218e9d 100644 --- a/crates/oakaudio/tests/processor_test.rs +++ b/crates/oak-audio/tests/processor_test.rs @@ -20,9 +20,9 @@ //! latency: the exact frame counts are drained after `flush`, while //! identity conversion is an immediate passthrough. -use oakaudio::error::{Error, OAKAUDIO_E_INVALID, OAKAUDIO_E_STATE, OAKAUDIO_OK}; -use oakaudio::params::{AudioParams, SampleFormat}; -use oakaudio::processor::Processor; +use oak_audio::error::{Error, OAKAUDIO_E_INVALID, OAKAUDIO_E_STATE, OAKAUDIO_OK}; +use oak_audio::params::{AudioParams, SampleFormat}; +use oak_audio::processor::Processor; /// Stereo f32_p planes of `frames` ramp samples. fn ramp_planes(frames: usize) -> Vec> { @@ -57,7 +57,7 @@ fn plane_mut_ptrs(planes: &mut [Vec]) -> Vec<*mut f32> { /// The crate error code of a failed call (the API surfaces /// `Box`). fn code(err: Box) -> i32 { - err.downcast_ref::() + err.downcast_ref::() .map(|e| e.code()) .unwrap_or(-1) } @@ -237,5 +237,5 @@ fn error_codes() { assert_eq!(Error::Invalid.code(), OAKAUDIO_E_INVALID); assert_eq!(Error::State.code(), OAKAUDIO_E_STATE); assert_eq!(Error::Failed("x".to_string()).code(), -60003); - assert_eq!(oakaudio::error::OAKAUDIO_OK, OAKAUDIO_OK); + assert_eq!(oak_audio::error::OAKAUDIO_OK, OAKAUDIO_OK); } diff --git a/crates/oakaudio/tests/sync_test.rs b/crates/oak-audio/tests/sync_test.rs similarity index 96% rename from crates/oakaudio/tests/sync_test.rs rename to crates/oak-audio/tests/sync_test.rs index b4b86f07d..4dee56b23 100644 --- a/crates/oakaudio/tests/sync_test.rs +++ b/crates/oak-audio/tests/sync_test.rs @@ -19,9 +19,9 @@ mod common; -use oakcore_rs::Rational; -use oakaudio::synchronizer::{place_by_source_time, place_by_waveform_offset, SourceClip}; -use oakaudio::waveformsync::{ +use oak_core::Rational; +use oak_audio::synchronizer::{place_by_source_time, place_by_waveform_offset, SourceClip}; +use oak_audio::waveformsync::{ estimate_envelope_offset, estimate_envelope_offset_valid, estimate_stretch_and_offset, extract_rms_envelope, }; @@ -217,7 +217,7 @@ fn crate_level_unmasked_wrappers() { let mut candidate = vec![0.0f64; 10]; candidate[2..].copy_from_slice(&reference[..8]); - let env = oakaudio::waveformsync::estimate_envelope_offset(&reference, &candidate, 100, 10); + let env = oak_audio::waveformsync::estimate_envelope_offset(&reference, &candidate, 100, 10); assert!(env.valid); assert_eq!(env.offset_samples, 200); assert!((env.confidence - 1.0).abs() < 1e-9); @@ -227,7 +227,7 @@ fn crate_level_unmasked_wrappers() { let ref_samples: Vec = (0..1000).map(|i| reference[i / 100] as f32).collect(); let mut cand_samples = vec![0.0f32; 1000]; cand_samples[200..].copy_from_slice(&ref_samples[..800]); - let raw = oakaudio::waveformsync::estimate_offset( + let raw = oak_audio::waveformsync::estimate_offset( &[ref_samples.as_slice()], &[cand_samples.as_slice()], 100, diff --git a/crates/oakaudio/tests/waveform_test.rs b/crates/oak-audio/tests/waveform_test.rs similarity index 98% rename from crates/oakaudio/tests/waveform_test.rs rename to crates/oak-audio/tests/waveform_test.rs index ebfb10514..4b1006819 100644 --- a/crates/oakaudio/tests/waveform_test.rs +++ b/crates/oak-audio/tests/waveform_test.rs @@ -22,8 +22,8 @@ mod common; use std::ffi::CString; use common::write_wav; -use oakcore_rs::Rational; -use oakaudio::waveform::{extract, AudioVisualWaveform, SamplePerChannel}; +use oak_core::Rational; +use oak_audio::waveform::{extract, AudioVisualWaveform, SamplePerChannel}; /// Fill `w` with 100 samples/channel of a 0..0.99 ramp at 100 Hz (1 s). fn fill_ramp(w: &mut AudioVisualWaveform) { diff --git a/crates/oak-cli/Cargo.toml b/crates/oak-cli/Cargo.toml index a36daec51..4dc8ce996 100644 --- a/crates/oak-cli/Cargo.toml +++ b/crates/oak-cli/Cargo.toml @@ -16,7 +16,7 @@ [package] name = "oak-cli" -version = "0.1.0" +version.workspace = true edition = "2021" description = "Oak Video Editor headless command-line consumer of the oak editor module crates (Rust)" license = "GPL-3.0-or-later" @@ -34,10 +34,10 @@ clap = { version = "4", features = ["derive"] } # oakcodec for the export formats/codecs, oaktask for the export task, # oakcommon/oakcore-rs for the shared value types). No liboakengine dylib, # no C ABI, no build.rs link step, no host shims. -oakcommon = { path = "../oakcommon" } -oakcore-rs = { path = "../oakcore" } -oaknode = { path = "../oaknode" } -oaktimeline = { path = "../oaktimeline" } -oakcodec = { path = "../oakcodec" } -oakrender = { path = "../oakrender" } -oaktask = { path = "../oaktask" } +oak-common = { path = "../oak-common" } +oak-core = { path = "../oak-core" } +oak-node = { path = "../oak-node" } + oak-timeline = { path = "../oak-timeline" } +oak-codec = { path = "../oak-codec" } +oak-render = { path = "../oak-render" } + oak-task = { path = "../oak-task" } diff --git a/crates/oak-cli/src/cmd/info.rs b/crates/oak-cli/src/cmd/info.rs index c2f8ba460..f05cefe0a 100644 --- a/crates/oak-cli/src/cmd/info.rs +++ b/crates/oak-cli/src/cmd/info.rs @@ -124,7 +124,7 @@ fn run_info(project: &str) -> i32 { /// Print one sequence block (`print_sequence` in cli/main.cpp) through the /// module sequence queries. -fn print_sequence(project: &engine::ProjectRef, seq_id: oaknode::id::NodeId, index: i64) { +fn print_sequence(project: &engine::ProjectRef, seq_id: oak_node::id::NodeId, index: i64) { let (name, length, frame_rate, track_counts, playhead) = { let guard = project.lock().unwrap_or_else(|e| e.into_inner()); ( diff --git a/crates/oak-cli/src/cmd/mod.rs b/crates/oak-cli/src/cmd/mod.rs index 3ba80c09a..42d422248 100644 --- a/crates/oak-cli/src/cmd/mod.rs +++ b/crates/oak-cli/src/cmd/mod.rs @@ -20,7 +20,7 @@ //! ([`crate::engine`] + the modules directly) — M14 R2 cut the facade //! dylib out of this crate: //! -//! - `probe` → an `oaknode::footage::FootageBehavior` probe +//! - `probe` → an `oak_node::footage::FootageBehavior` probe //! - `info` → `crate::engine::load_project` + the project graph //! walks //! - `render` → `crate::engine::render_manager_init` + the video/ diff --git a/crates/oak-cli/src/cmd/probe.rs b/crates/oak-cli/src/cmd/probe.rs index 4ee21a744..ed5c4b075 100644 --- a/crates/oak-cli/src/cmd/probe.rs +++ b/crates/oak-cli/src/cmd/probe.rs @@ -19,13 +19,13 @@ //! cli/main.cpp). //! //! Runs entirely through the module crates (M14 R2): an -//! [`oaknode::footage::FootageBehavior`] probes the file through the +//! [`oak_node::footage::FootageBehavior`] probes the file through the //! oakcodec decoder registry and the CLI prints what the module records: //! the decoder id, the footage duration and the probed stream inventory //! (per-stream duration in rational seconds). A missing file prints //! `error: probe: file does not exist: ` on stderr and exits 1. -use oaknode::footage::FootageBehavior; +use oak_node::footage::FootageBehavior; use crate::cmd::{EXIT_ERROR, EXIT_OK}; use crate::fmt; @@ -114,7 +114,7 @@ fn run_probe(mediafile: &str) -> i32 { } /// A rational as floating-point seconds (0 on a zero denominator). -fn rational_secs(r: oakcore_rs::Rational) -> f64 { +fn rational_secs(r: oak_core::Rational) -> f64 { if r.denominator() != 0 { r.numerator() as f64 / r.denominator() as f64 } else { diff --git a/crates/oak-cli/src/cmd/render.rs b/crates/oak-cli/src/cmd/render.rs index a608d48b7..7e23dc65e 100644 --- a/crates/oak-cli/src/cmd/render.rs +++ b/crates/oak-cli/src/cmd/render.rs @@ -38,7 +38,7 @@ //! project/sequence/argument failures exit 1; bad seconds exit 64 //! (usage). Frame progress goes to stderr (`frame N: T s`). -use oakcore_rs::TimeRange; +use oak_core::TimeRange; use crate::cmd::{EXIT_ERROR, EXIT_OK, EXIT_RENDER_UNAVAILABLE, EXIT_USAGE}; use crate::engine; @@ -148,7 +148,7 @@ fn run_render(project: &str, start: f64, end: f64, out_dir: &str) -> i32 { if time >= end { break; } - let time_r = oakcore_rs::Rational::new(index * i64::from(fr_den), i64::from(fr_num)); + let time_r = oak_core::Rational::new(index * i64::from(fr_den), i64::from(fr_num)); let montage = engine::video_montage(&project_ref, seq_id, time_r); let frame = match engine::render_frame(seq_id, time_r, montage, width, height) { Ok(f) => f, @@ -183,8 +183,8 @@ fn run_render(project: &str, start: f64, end: f64, out_dir: &str) -> i32 { let start_ts = (start * fr_num as f64 / fr_den as f64).round() as i64; let length_ts = ((end - start) * fr_num as f64 / fr_den as f64).round() as i64; let range = TimeRange::new( - oakcore_rs::Rational::new(start_ts * i64::from(fr_den), i64::from(fr_num)), - oakcore_rs::Rational::new( + oak_core::Rational::new(start_ts * i64::from(fr_den), i64::from(fr_num)), + oak_core::Rational::new( (start_ts + length_ts) * i64::from(fr_den), i64::from(fr_num), ), diff --git a/crates/oak-cli/src/cmd/transcode.rs b/crates/oak-cli/src/cmd/transcode.rs index 04e6b7060..0bcaa4f9b 100644 --- a/crates/oak-cli/src/cmd/transcode.rs +++ b/crates/oak-cli/src/cmd/transcode.rs @@ -18,7 +18,7 @@ //! "media in, renders out" round trip (port of `cmd_transcode()` in //! cli/main.cpp), entirely through the module crates (M14 R2). //! -//! The source is probed with an [`oaknode::footage::FootageBehavior`] +//! The source is probed with an [`oak_node::footage::FootageBehavior`] //! (geometry / frame rate / duration), then a temporary sequence is //! assembled the same way the facade did: a scratch project holds the //! sequence (the facade's documented `oakengine_sequence_new` deviation), @@ -44,8 +44,8 @@ //! duration-less sources. Failures exit 1 (general error); bad arguments //! exit 64. -use oaknode::footage::FootageBehavior; -use oaknode::track::TrackType; +use oak_node::footage::FootageBehavior; +use oak_node::track::TrackType; use crate::cmd::{EXIT_ERROR, EXIT_OK, EXIT_USAGE}; use crate::engine; @@ -135,7 +135,7 @@ fn run_transcode(input: &str, out: &str, width: Option<&str>, is_ppm: bool) -> i /// streams, one audio track/clip). struct Assembly { project: engine::ProjectRef, - sequence: oaknode::id::NodeId, + sequence: oak_node::id::NodeId, } /// Build the temporary sequence for the render/export stage. @@ -151,7 +151,7 @@ fn assemble_sequence( if let Err(e) = engine::render_manager_init() { return Err(format!("cannot initialize the render manager: {e}")); } - let project = oaknode::project::Project::new(); + let project = oak_node::project::Project::new(); let sequence = engine::create_sequence(&project, "transcode"); engine::set_sequence_video_params(&project, sequence, out_w, out_h, fr_num, fr_den); @@ -211,7 +211,7 @@ fn transcode_ppm( } for i in 0..frames { - let time = oakcore_rs::Rational::new(i * i64::from(fr_den), i64::from(fr_num)); + let time = oak_core::Rational::new(i * i64::from(fr_den), i64::from(fr_num)); let montage = engine::video_montage(&assembly.project, assembly.sequence, time); let frame = match engine::render_frame(assembly.sequence, time, montage, out_w, out_h) { Ok(f) => f, @@ -290,9 +290,9 @@ fn write_audio_wav( fr_num: i32, fr_den: i32, ) -> i32 { - let range = oakcore_rs::TimeRange::new( - oakcore_rs::Rational::new(0, 1), - oakcore_rs::Rational::new(frames * i64::from(fr_den), i64::from(fr_num)), + let range = oak_core::TimeRange::new( + oak_core::Rational::new(0, 1), + oak_core::Rational::new(frames * i64::from(fr_den), i64::from(fr_num)), ); let montage = engine::audio_montage(&assembly.project, assembly.sequence, range); let audio = match engine::render_audio(assembly.sequence, range, montage) { diff --git a/crates/oak-cli/src/engine.rs b/crates/oak-cli/src/engine.rs index 7b86a89d5..2d72c63b6 100644 --- a/crates/oak-cli/src/engine.rs +++ b/crates/oak-cli/src/engine.rs @@ -29,26 +29,26 @@ //! `oakengine_renderer_render_frame`, ...) did over the same module APIs; //! the facade keeps its own copies for the frozen C ABI. Combinators that //! belong upstream (the effect-chain and timeline composites) are M14 -//! follow-up candidates for `oaknode::ops`; kept local until then. +//! follow-up candidates for `oak_node::ops`; kept local until then. use std::path::Path; use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::{Rational, TimeRange}; -use oaknode::block::{self, ClipBlockBehavior}; -use oaknode::footage::FootageBehavior; -use oaknode::graph::Graph; -use oaknode::id::NodeId; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; -use oaknode::value::VideoParams; -use oaktimeline::undogeneral::TimelineAddTrackCommand; -use oaktimeline::undopointer::TrackPlaceBlockCommand; -use oaktimeline::util::NodeRef; -use oakrender::manager::RenderManager; -use oakrender::procpool::bgra8_to_rgba8; -use oakrender::ticket::{ +use oak_core::{Rational, TimeRange}; +use oak_node::block::{self, ClipBlockBehavior}; +use oak_node::footage::FootageBehavior; +use oak_node::graph::Graph; +use oak_node::id::NodeId; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_node::value::VideoParams; +use oak_timeline::undogeneral::TimelineAddTrackCommand; +use oak_timeline::undopointer::TrackPlaceBlockCommand; +use oak_timeline::util::NodeRef; +use oak_render::manager::RenderManager; +use oak_render::procpool::bgra8_to_rgba8; +use oak_render::ticket::{ AudioTicketParams, MontageClip, TicketPayload, VideoTicketParams, }; @@ -71,7 +71,7 @@ fn lock(p: &ProjectRef) -> MutexGuard<'_, Project> { /// `oakengine_project_load`. pub fn load_project(path: &str) -> Result { let xml = std::fs::read_to_string(path).map_err(|e| e.to_string())?; - let project = oaknode::serializer::load(&xml).map_err(|e| e.to_string())?; + let project = oak_node::serializer::load(&xml).map_err(|e| e.to_string())?; let p = Path::new(path); let abs = if p.is_absolute() { p.to_path_buf() @@ -400,7 +400,7 @@ pub fn place_footage_clip( let footage_id = { let mut guard = lock(project); let (mut core, behavior) = FootageBehavior::create(); - core.set_standard_value("file_in", -1, oaknode::value::NodeValue::Text(filename.to_string())); + core.set_standard_value("file_in", -1, oak_node::value::NodeValue::Text(filename.to_string())); let id = guard.graph.add_node(core, behavior); if let Some(f) = footage_behavior_mut(&mut guard.graph, id) { f.filename = filename.to_string(); @@ -603,7 +603,7 @@ pub fn audio_montage(p: &ProjectRef, seq_id: NodeId, range: TimeRange) -> Vec Result<(), String> { match RenderManager::init() { Ok(()) => Ok(()), - Err(oakrender::error::Error::State) => Ok(()), + Err(oak_render::error::Error::State) => Ok(()), Err(e) => Err(e.to_string()), } } @@ -620,7 +620,7 @@ pub struct RenderedFrame { pub width: i32, /// Height in pixels. pub height: i32, - /// Pixel format (`oakcore_rs::PixelFormat` as int). + /// Pixel format (`oak_core::PixelFormat` as int). pub format: i32, /// Bytes per scanline (stride). pub linesize: i32, @@ -657,7 +657,7 @@ pub fn render_frame( m.tickets.wait(id).map_err(|e| e.to_string())?; let result = m.tickets.result(id).ok_or_else(|| "render ticket produced no result".to_string())?; match &result { - Ok(TicketPayload::Video(oakrender::texture::Texture::Cpu(frame))) => { + Ok(TicketPayload::Video(oak_render::texture::Texture::Cpu(frame))) => { Ok(RenderedFrame { width: frame.width, height: frame.height, @@ -679,7 +679,7 @@ pub fn render_frame( /// Copy a process-backend shm frame (BGRA8 slot) out into the CLI's /// RGBA8 u8 frame layout (format 0, 4 channels — the PPM writer's RGB /// order). Necessary copy: the CLI owns the pixels it writes to disk. -fn shm_to_rendered_frame(frame: &oakrender::procpool::ShmFrameRef) -> RenderedFrame { +fn shm_to_rendered_frame(frame: &oak_render::procpool::ShmFrameRef) -> RenderedFrame { let meta = &frame.meta; let pixels = frame .shm @@ -778,18 +778,18 @@ pub fn export_sequence( return Err("sequence has no valid frame rate".to_string()); } let out_num = frames * i64::from(fr_den); - let encoding = oaktask::export::EncodingParams { + let encoding = oak_task::export::EncodingParams { filename: out.to_string(), - format: oakcodec::exportformat::Format::MPEG4Video as i32, + format: oak_codec::exportformat::Format::MPEG4Video as i32, video_enabled: true, - video_codec: oakcodec::exportcodec::Codec::H264 as i32, + video_codec: oak_codec::exportcodec::Codec::H264 as i32, video_width: width, video_height: height, video_time_base_num: fr_den, video_time_base_den: fr_num, video_pixel_format: 0, audio_enabled: true, - audio_codec: oakcodec::exportcodec::Codec::AAC as i32, + audio_codec: oak_codec::exportcodec::Codec::AAC as i32, audio_sample_rate: 48000, audio_channel_layout: 0x3, subtitles_enabled: false, @@ -801,8 +801,8 @@ pub fn export_sequence( custom_range_out_num: out_num as i32, custom_range_out_den: fr_num, }; - let inner = oaktask::export::ExportTask::new((project.clone(), seq_id), encoding); - let mut driver = oaktask::task::Task::new("Exporting...", None); + let inner = oak_task::export::ExportTask::new((project.clone(), seq_id), encoding); + let mut driver = oak_task::task::Task::new("Exporting...", None); driver.set_behavior(Box::new(inner)); driver.start().map_err(|_| { driver diff --git a/crates/oakcodec/Cargo.lock b/crates/oak-codec/Cargo.lock similarity index 100% rename from crates/oakcodec/Cargo.lock rename to crates/oak-codec/Cargo.lock diff --git a/crates/oakcodec/Cargo.toml b/crates/oak-codec/Cargo.toml similarity index 86% rename from crates/oakcodec/Cargo.toml rename to crates/oak-codec/Cargo.toml index 8fb5eb5ff..48976c0fe 100644 --- a/crates/oakcodec/Cargo.toml +++ b/crates/oak-codec/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakcodec" -version = "0.1.0" +name = "oak-codec" +version.workspace = true edition = "2021" description = "Oak Video Editor media codec module (Rust)" license = "GPL-3.0-or-later" @@ -9,9 +9,9 @@ license = "GPL-3.0-or-later" crate-type = ["staticlib", "rlib"] [dependencies] -oakcommon = { path = "../oakcommon" } -oakffmpeg-link = { path = "../oakffmpeg-link" } -oakcore-rs = { path = "../oakcore" } +oak-common = { path = "../oak-common" } +oak-ffmpeg-link = { path = "../oak-ffmpeg-link" } +oak-core = { path = "../oak-core" } # Real media decode/encode. The C++ ffmpeg_bridge library existed only to # absorb FFmpeg API churn; the Rust crate calls ffmpeg-next directly. # diff --git a/crates/oakcodec/README.md b/crates/oak-codec/README.md similarity index 100% rename from crates/oakcodec/README.md rename to crates/oak-codec/README.md diff --git a/crates/oakcodec/src/audioparams.rs b/crates/oak-codec/src/audioparams.rs similarity index 100% rename from crates/oakcodec/src/audioparams.rs rename to crates/oak-codec/src/audioparams.rs diff --git a/crates/oakcodec/src/conformmanager.rs b/crates/oak-codec/src/conformmanager.rs similarity index 99% rename from crates/oakcodec/src/conformmanager.rs rename to crates/oak-codec/src/conformmanager.rs index dda681af6..391c96cbb 100644 --- a/crates/oakcodec/src/conformmanager.rs +++ b/crates/oak-codec/src/conformmanager.rs @@ -22,7 +22,7 @@ //! `Unavailable`. Deterministic per-channel filenames derive from the //! source + target audio params. -use oakcommon::filefunctions::FileFunctions; +use oak_common::filefunctions::FileFunctions; use std::path::Path; /// Conform state of one audio stream. diff --git a/crates/oakcodec/src/decoder.rs b/crates/oak-codec/src/decoder.rs similarity index 99% rename from crates/oakcodec/src/decoder.rs rename to crates/oak-codec/src/decoder.rs index 2ea9fc1f7..da86d9538 100644 --- a/crates/oakcodec/src/decoder.rs +++ b/crates/oak-codec/src/decoder.rs @@ -20,14 +20,14 @@ //! FFmpeg/OIIO subclasses become the [`Decoder`] trait (decision 2 in //! README.md); probe/dispatch lives on the registry functions at the //! bottom of this module. Audio is handled in raw interleaved-float -//! buffers matching the C ABI, not `oakcore_rs::SampleBuffer` (which the +//! buffers matching the C ABI, not `oak_core::SampleBuffer` (which the //! crate does not export). use std::path::Path; use std::sync::{Arc, Mutex, OnceLock}; -use oakcommon::cancelatom::CancelAtom; -use oakcore_rs::{Rational, TimeRange}; +use oak_common::cancelatom::CancelAtom; +use oak_core::{Rational, TimeRange}; use crate::footagedescription::FootageDescription; use crate::frame::Frame; diff --git a/crates/oakcodec/src/encoder.rs b/crates/oak-codec/src/encoder.rs similarity index 99% rename from crates/oakcodec/src/encoder.rs rename to crates/oak-codec/src/encoder.rs index 0ace7ac1e..77219a786 100644 --- a/crates/oakcodec/src/encoder.rs +++ b/crates/oak-codec/src/encoder.rs @@ -24,7 +24,7 @@ use std::sync::{Arc, Mutex, OnceLock}; -use oakcore_rs::{PixelFormat, SampleFormat}; +use oak_core::{PixelFormat, SampleFormat}; use crate::encodingparams::EncodingParams; use crate::frame::Frame; diff --git a/crates/oakcodec/src/encodingparams.rs b/crates/oak-codec/src/encodingparams.rs similarity index 99% rename from crates/oakcodec/src/encodingparams.rs rename to crates/oak-codec/src/encodingparams.rs index 1c9c328f5..f49310656 100644 --- a/crates/oakcodec/src/encodingparams.rs +++ b/crates/oak-codec/src/encodingparams.rs @@ -21,7 +21,7 @@ //! `include/codec/encoder.h`. The Rust struct mirrors the POD verbatim so //! `ffi.rs` can marshal it without translation. -use oakcore_rs::{PixelFormat, SampleFormat}; +use oak_core::{PixelFormat, SampleFormat}; /// `VideoParams::Interlacing` values. #[derive(Clone, Copy, Debug, PartialEq, Eq)] diff --git a/crates/oakcodec/src/error.rs b/crates/oak-codec/src/error.rs similarity index 100% rename from crates/oakcodec/src/error.rs rename to crates/oak-codec/src/error.rs diff --git a/crates/oakcodec/src/exportcodec.rs b/crates/oak-codec/src/exportcodec.rs similarity index 100% rename from crates/oakcodec/src/exportcodec.rs rename to crates/oak-codec/src/exportcodec.rs diff --git a/crates/oakcodec/src/exportformat.rs b/crates/oak-codec/src/exportformat.rs similarity index 99% rename from crates/oakcodec/src/exportformat.rs rename to crates/oak-codec/src/exportformat.rs index 3320e665e..78ca3fa0d 100644 --- a/crates/oakcodec/src/exportformat.rs +++ b/crates/oak-codec/src/exportformat.rs @@ -19,7 +19,7 @@ //! Mirrors `src/codec/src/exportformat.h`. As with `ExportCodec`, the enum //! values are the serialized-file contract and must never be reordered. -use oakcore_rs::SampleFormat; +use oak_core::SampleFormat; use crate::exportcodec::Codec; diff --git a/crates/oakcodec/src/ffmpeg.rs b/crates/oak-codec/src/ffmpeg.rs similarity index 99% rename from crates/oakcodec/src/ffmpeg.rs rename to crates/oak-codec/src/ffmpeg.rs index 12df9dc27..7fb5f22f4 100644 --- a/crates/oakcodec/src/ffmpeg.rs +++ b/crates/oak-codec/src/ffmpeg.rs @@ -56,10 +56,10 @@ use ffmpeg::software::{resampling, scaling}; use ffmpeg::{ChannelLayout, Dictionary, Error as FfmpegError, Rational as FfRational}; use ffmpeg_next as ffmpeg; -use oakcommon::cancelatom::CancelAtom; -use oakcommon::ocioutils::PixelFormat as OakPixelFormat; -use oakcommon::videoparams::{Interlacing, VideoParams, VideoType}; -use oakcore_rs::{PixelFormat, Rational, SampleFormat, TimeRange}; +use oak_common::cancelatom::CancelAtom; +use oak_common::ocioutils::PixelFormat as OakPixelFormat; +use oak_common::videoparams::{Interlacing, VideoParams, VideoType}; +use oak_core::{PixelFormat, Rational, SampleFormat, TimeRange}; use crate::audioparams::AudioParams; use crate::decoder::{CodecStream, Decoder, OakRenderTexture, RetrieveAudioStatus, RetrieveVideoParams}; @@ -2435,7 +2435,7 @@ fn c_string_1024(buf: &[u8; 1024]) -> String { mod tests { use super::*; use crate::decoder::RetrieveVideoParams; - use oakcore_rs::Rational; + use oak_core::Rational; fn video_params() -> RetrieveVideoParams { RetrieveVideoParams { diff --git a/crates/oakcodec/src/footagedescription.rs b/crates/oak-codec/src/footagedescription.rs similarity index 97% rename from crates/oakcodec/src/footagedescription.rs rename to crates/oak-codec/src/footagedescription.rs index 245c227dc..ee6899128 100644 --- a/crates/oakcodec/src/footagedescription.rs +++ b/crates/oak-codec/src/footagedescription.rs @@ -19,13 +19,13 @@ //! Mirrors `src/codec/src/footagedescription.h`. A value type describing //! the streams a `Decoder::probe()` found in a file. Video and subtitle //! streams are stored as oakcommon by-value handles; audio streams as -//! `oakcore_rs::TimeRangeList`/raw audio params. The original's +//! `oak_core::TimeRangeList`/raw audio params. The original's //! `Track::Type` mapping and XML load/save are intentionally not reproduced //! (NOTES.md §4) — use [`FootageDescription::stream_is_video`] etc. -use oakcommon::subtitleparams::SubtitleParams; -use oakcommon::videoparams::VideoParams; -use oakcore_rs::{Rational, TimeRange}; +use oak_common::subtitleparams::SubtitleParams; +use oak_common::videoparams::VideoParams; +use oak_core::{Rational, TimeRange}; use crate::audioparams::AudioParams; @@ -216,7 +216,7 @@ mod tests { let mut vp = VideoParams::new_basic( 1920, 1080, - oakcommon::ocioutils::PixelFormat::from_code(0), + oak_common::ocioutils::PixelFormat::from_code(0), 4, 1, 1, diff --git a/crates/oakcodec/src/frame.rs b/crates/oak-codec/src/frame.rs similarity index 98% rename from crates/oakcodec/src/frame.rs rename to crates/oak-codec/src/frame.rs index 7ff263419..568ef0ae2 100644 --- a/crates/oakcodec/src/frame.rs +++ b/crates/oak-codec/src/frame.rs @@ -22,8 +22,8 @@ //! itself is a plain `Vec`. Line-size and pixel-format math lives //! here. -use oakcommon::videoparams::VideoParams; -use oakcore_rs::{PixelFormat, Rational}; +use oak_common::videoparams::VideoParams; +use oak_core::{PixelFormat, Rational}; /// Number of channels in the internal RGBA pipeline layout /// (`VideoParams::k_internal_channel_count == k_rgba_channel_count == 4`). @@ -331,7 +331,7 @@ impl Frame { #[cfg(test)] mod tests { use super::*; - use oakcommon::ocioutils::PixelFormat as OakPixelFormat; + use oak_common::ocioutils::PixelFormat as OakPixelFormat; fn frame(w: i32, h: i32) -> Frame { let params = VideoParams::new_basic(w, h, OakPixelFormat::from_code(0), 4, 1, 1, 0, 1); @@ -422,7 +422,7 @@ mod tests { #[cfg(test)] mod tests_extra { use super::*; - use oakcommon::ocioutils::PixelFormat as OakPixelFormat; + use oak_common::ocioutils::PixelFormat as OakPixelFormat; fn frame(w: i32, h: i32) -> Frame { let params = VideoParams::new_basic(w, h, OakPixelFormat::from_code(0), 4, 1, 1, 0, 1); diff --git a/crates/oakcodec/src/framemanager.rs b/crates/oak-codec/src/framemanager.rs similarity index 98% rename from crates/oakcodec/src/framemanager.rs rename to crates/oak-codec/src/framemanager.rs index 60d14e821..7d4a19564 100644 --- a/crates/oakcodec/src/framemanager.rs +++ b/crates/oak-codec/src/framemanager.rs @@ -27,7 +27,7 @@ use std::sync::{Arc, Mutex, OnceLock}; use std::thread; use std::time::Duration; -use oakcommon::videoparams::VideoParams; +use oak_common::videoparams::VideoParams; use crate::frame::Frame; /// `olive::FrameManager`: singleton frame pool with background GC. @@ -148,7 +148,7 @@ fn frame_matches(frame: &Frame, params: &VideoParams) -> bool { #[cfg(test)] mod tests { use super::*; - use oakcommon::ocioutils::PixelFormat as OakPixelFormat; + use oak_common::ocioutils::PixelFormat as OakPixelFormat; fn test_params(w: i32, h: i32) -> VideoParams { VideoParams::new_basic(w, h, OakPixelFormat::from_code(0), 4, 1, 1, 0, 1) diff --git a/crates/oakcodec/src/hwdecode.rs b/crates/oak-codec/src/hwdecode.rs similarity index 99% rename from crates/oakcodec/src/hwdecode.rs rename to crates/oak-codec/src/hwdecode.rs index c7f5ec282..a0a542645 100644 --- a/crates/oakcodec/src/hwdecode.rs +++ b/crates/oak-codec/src/hwdecode.rs @@ -62,7 +62,7 @@ pub const CONFIG_KEY_HARDWARE_DECODING: &str = "HardwareDecoding"; /// string accessor, same convention as the app's config helpers — the /// store's typed `get_bool` only parses pre-typed Bool entries). pub fn hardware_decoding_enabled() -> bool { - match oakcommon::configstore::ConfigStore::instance() + match oak_common::configstore::ConfigStore::instance() .get(None, CONFIG_KEY_HARDWARE_DECODING) { Ok(value) => value != "false", diff --git a/crates/oakcodec/src/lib.rs b/crates/oak-codec/src/lib.rs similarity index 98% rename from crates/oakcodec/src/lib.rs rename to crates/oak-codec/src/lib.rs index 0bb3e4615..865476335 100644 --- a/crates/oakcodec/src/lib.rs +++ b/crates/oak-codec/src/lib.rs @@ -107,4 +107,4 @@ pub(crate) fn lock_tests() -> TestLock { // link flags (the static FFmpeg's transitive dependencies) reach the // final link — rustc prunes the flags of an unreferenced rlib. #[used] -static FORCE_FFMPEG_LINK: fn() = oakffmpeg_link::force_link; +static FORCE_FFMPEG_LINK: fn() = oak_ffmpeg_link::force_link; diff --git a/crates/oakcodec/src/oiio.rs b/crates/oak-codec/src/oiio.rs similarity index 96% rename from crates/oakcodec/src/oiio.rs rename to crates/oak-codec/src/oiio.rs index 0774aa66d..c204c5dee 100644 --- a/crates/oakcodec/src/oiio.rs +++ b/crates/oak-codec/src/oiio.rs @@ -60,7 +60,7 @@ impl Decoder for OIIODecoder { fn probe( &self, _filename: &str, - _cancelled: Option<&oakcommon::cancelatom::CancelAtom>, + _cancelled: Option<&oak_common::cancelatom::CancelAtom>, ) -> Option { // Probing is a dylib operation; without it we cannot report anything. None @@ -105,7 +105,7 @@ impl Decoder for OIIODecoder { fn retrieve_audio( &self, _dest: &mut [f32], - _range: &oakcore_rs::TimeRange, + _range: &oak_core::TimeRange, _sample_rate: i32, _channel_layout: u64, ) -> crate::error::Result { @@ -118,7 +118,7 @@ impl Decoder for OIIODecoder { _sample_rate: i32, _channel_layout: u64, _sample_format: i32, - _cancelled: Option<&oakcommon::cancelatom::CancelAtom>, + _cancelled: Option<&oak_common::cancelatom::CancelAtom>, ) -> crate::error::Result<()> { Err(crate::error::Error::Failed(Self::NOT_AVAILABLE.to_string())) } @@ -204,11 +204,11 @@ impl Encoder for OIIOEncoder { )) } - fn desired_pixel_format(&self) -> Option { + fn desired_pixel_format(&self) -> Option { None } - fn desired_sample_format(&self) -> Option { + fn desired_sample_format(&self) -> Option { None } @@ -229,7 +229,7 @@ mod tests { use super::*; use crate::decoder::RetrieveVideoParams; use crate::encodingparams::EncodingParams; - use oakcore_rs::{Rational, TimeRange}; + use oak_core::{Rational, TimeRange}; fn video_params() -> RetrieveVideoParams { RetrieveVideoParams { diff --git a/crates/oakcodec/src/oiioframebridge.rs b/crates/oak-codec/src/oiioframebridge.rs similarity index 99% rename from crates/oakcodec/src/oiioframebridge.rs rename to crates/oak-codec/src/oiioframebridge.rs index 5dcf13307..091a2849e 100644 --- a/crates/oakcodec/src/oiioframebridge.rs +++ b/crates/oak-codec/src/oiioframebridge.rs @@ -30,10 +30,10 @@ //! timestamp and time base alongside the raw pixel rows, so a buffer can be //! turned back into an equivalent [`Frame`] without any external state. -use oakcommon::ocioutils::PixelFormat as OakPixelFormat; -use oakcommon::videoparams::VideoParams; +use oak_common::ocioutils::PixelFormat as OakPixelFormat; +use oak_common::videoparams::VideoParams; use crate::frame::Frame; -use oakcore_rs::Rational; +use oak_core::Rational; use std::ffi::c_int; /// Fixed header size, in bytes, of an OIIO frame buffer. diff --git a/crates/oakcodec/src/planarfiledevice.rs b/crates/oak-codec/src/planarfiledevice.rs similarity index 100% rename from crates/oakcodec/src/planarfiledevice.rs rename to crates/oak-codec/src/planarfiledevice.rs diff --git a/crates/oakcodec/src/proxymanager.rs b/crates/oak-codec/src/proxymanager.rs similarity index 99% rename from crates/oakcodec/src/proxymanager.rs rename to crates/oak-codec/src/proxymanager.rs index 35866a159..24ea3c6eb 100644 --- a/crates/oakcodec/src/proxymanager.rs +++ b/crates/oak-codec/src/proxymanager.rs @@ -23,8 +23,8 @@ //! with the compiled-in defaults as fallback (1280x720 / divider 1 / crf 23 //! / "mp4" / "veryfast" / audio included). -use oakcommon::configstore::ConfigStore; -use oakcommon::filefunctions::FileFunctions; +use oak_common::configstore::ConfigStore; +use oak_common::filefunctions::FileFunctions; use std::path::Path; /// Proxy state of a proxy file on disk. diff --git a/crates/oakcodec/src/realmedia_tests.rs b/crates/oak-codec/src/realmedia_tests.rs similarity index 98% rename from crates/oakcodec/src/realmedia_tests.rs rename to crates/oak-codec/src/realmedia_tests.rs index 9ed60b990..a6927a4ea 100644 --- a/crates/oakcodec/src/realmedia_tests.rs +++ b/crates/oak-codec/src/realmedia_tests.rs @@ -26,8 +26,8 @@ //! compiled without `#[cfg(test)]` and cannot resolve those symbols; see //! `tests/ffi_contract_test.rs`). -use oakcommon::ocioutils::PixelFormat as OakPixelFormat; -use oakcommon::videoparams::VideoParams; +use oak_common::ocioutils::PixelFormat as OakPixelFormat; +use oak_common::videoparams::VideoParams; use crate::decoder::{ CodecStream, Decoder, RenderMode, RetrieveAudioStatus, RetrieveVideoParams, K_COLOR_RANGE_DEFAULT, @@ -35,7 +35,7 @@ use crate::decoder::{ use crate::encoder::create_from_params; use crate::ffmpeg::FFmpegDecoder; use crate::frame::Frame; -use oakcore_rs::{PixelFormat, Rational, TimeRange}; +use oak_core::{PixelFormat, Rational, TimeRange}; use std::sync::Arc; /// `tests/demo.mp4` at the repository root. @@ -300,7 +300,7 @@ static HW_TEST_LOCK: std::sync::Mutex<()> = std::sync::Mutex::new(()); #[test] fn hardware_decode_matches_software_decode() { let _guard = HW_TEST_LOCK.lock().unwrap_or_else(|e| e.into_inner()); - let config = oakcommon::configstore::ConfigStore::instance(); + let config = oak_common::configstore::ConfigStore::instance(); let key = crate::hwdecode::CONFIG_KEY_HARDWARE_DECODING; let decode_at = |time: i64| -> (Option, Arc) { diff --git a/crates/oakcodec/src/task.rs b/crates/oak-codec/src/task.rs similarity index 100% rename from crates/oakcodec/src/task.rs rename to crates/oak-codec/src/task.rs diff --git a/crates/oakcodec/src/testmedia.rs b/crates/oak-codec/src/testmedia.rs similarity index 97% rename from crates/oakcodec/src/testmedia.rs rename to crates/oak-codec/src/testmedia.rs index 34d7d6077..695b08000 100644 --- a/crates/oakcodec/src/testmedia.rs +++ b/crates/oak-codec/src/testmedia.rs @@ -37,9 +37,9 @@ use std::path::Path; -use oakcommon::ocioutils::PixelFormat as OakPixelFormat; -use oakcommon::videoparams::VideoParams; -use oakcore_rs::{PixelFormat, Rational, SampleFormat}; +use oak_common::ocioutils::PixelFormat as OakPixelFormat; +use oak_common::videoparams::VideoParams; +use oak_core::{PixelFormat, Rational, SampleFormat}; use crate::encodingparams::EncodingParams; use crate::encoder::create_from_params; diff --git a/crates/oakcodec/src/timecodemetadata.rs b/crates/oak-codec/src/timecodemetadata.rs similarity index 99% rename from crates/oakcodec/src/timecodemetadata.rs rename to crates/oak-codec/src/timecodemetadata.rs index b76152267..c6cdb050f 100644 --- a/crates/oakcodec/src/timecodemetadata.rs +++ b/crates/oak-codec/src/timecodemetadata.rs @@ -19,7 +19,7 @@ //! Mirrors `src/codec/src/timecodemetadata.h`: parse an SMPTE timecode //! string or a BWF `time reference` chunk into a rational media timestamp. -use oakcore_rs::Rational; +use oak_core::Rational; /// `TimecodeMetadata::SourceTime` — the parsed result. pub struct SourceTime { @@ -174,7 +174,7 @@ impl SourceTime { /// sample count over `sample_rate` is reduced by their GCD; if the /// reduced numerator or denominator exceed `i32::MAX` the value falls /// back to the (capped, reduced) `Rational::new(samples, sample_rate)` - /// approximation, since `oakcore_rs::Rational` exposes no `from_double`. + /// approximation, since `oak_core::Rational` exposes no `from_double`. pub fn from_bwf_time_reference(time_reference: &str, sample_rate: i32) -> SourceTime { if sample_rate <= 0 { return SourceTime::invalid(); diff --git a/crates/oakcodec/tarpaulin-report.html b/crates/oak-codec/tarpaulin-report.html similarity index 100% rename from crates/oakcodec/tarpaulin-report.html rename to crates/oak-codec/tarpaulin-report.html diff --git a/crates/oakcodec/tests/ffi_contract_test.rs b/crates/oak-codec/tests/ffi_contract_test.rs similarity index 100% rename from crates/oakcodec/tests/ffi_contract_test.rs rename to crates/oak-codec/tests/ffi_contract_test.rs diff --git a/crates/oakcommon/.cargo/config.toml b/crates/oak-common/.cargo/config.toml similarity index 100% rename from crates/oakcommon/.cargo/config.toml rename to crates/oak-common/.cargo/config.toml diff --git a/crates/oakcommon/Cargo.lock b/crates/oak-common/Cargo.lock similarity index 100% rename from crates/oakcommon/Cargo.lock rename to crates/oak-common/Cargo.lock diff --git a/crates/oakcommon/Cargo.toml b/crates/oak-common/Cargo.toml similarity index 95% rename from crates/oakcommon/Cargo.toml rename to crates/oak-common/Cargo.toml index 8291fd1e4..4ed96ebdc 100644 --- a/crates/oakcommon/Cargo.toml +++ b/crates/oak-common/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakcommon" -version = "0.1.0" +name = "oak-common" +version.workspace = true edition = "2021" description = "Oak Video Editor shared utilities (Rust)" license = "GPL-3.0-or-later" @@ -17,7 +17,7 @@ crate-type = ["staticlib", "rlib"] test-stubs = [] [dependencies] -oakcore-rs = { path = "../oakcore" } +oak-core = { path = "../oak-core" } quick-xml = "0.41.0" log = "0.4" # TOML persistence for the application config (configstore.rs). Already in diff --git a/crates/oakcommon/README.md b/crates/oak-common/README.md similarity index 100% rename from crates/oakcommon/README.md rename to crates/oak-common/README.md diff --git a/crates/oakcommon/src/cancelatom.rs b/crates/oak-common/src/cancelatom.rs similarity index 100% rename from crates/oakcommon/src/cancelatom.rs rename to crates/oak-common/src/cancelatom.rs diff --git a/crates/oakcommon/src/colortransform.rs b/crates/oak-common/src/colortransform.rs similarity index 100% rename from crates/oakcommon/src/colortransform.rs rename to crates/oak-common/src/colortransform.rs diff --git a/crates/oakcommon/src/commandlineparser.rs b/crates/oak-common/src/commandlineparser.rs similarity index 100% rename from crates/oakcommon/src/commandlineparser.rs rename to crates/oak-common/src/commandlineparser.rs diff --git a/crates/oakcommon/src/configstore.rs b/crates/oak-common/src/configstore.rs similarity index 100% rename from crates/oakcommon/src/configstore.rs rename to crates/oak-common/src/configstore.rs diff --git a/crates/oakcommon/src/dbg_print_test.rs b/crates/oak-common/src/dbg_print_test.rs similarity index 100% rename from crates/oakcommon/src/dbg_print_test.rs rename to crates/oak-common/src/dbg_print_test.rs diff --git a/crates/oakcommon/src/debug.rs b/crates/oak-common/src/debug.rs similarity index 100% rename from crates/oakcommon/src/debug.rs rename to crates/oak-common/src/debug.rs diff --git a/crates/oakcommon/src/displayicc.rs b/crates/oak-common/src/displayicc.rs similarity index 99% rename from crates/oakcommon/src/displayicc.rs rename to crates/oak-common/src/displayicc.rs index 9582ecdb0..dca66d646 100644 --- a/crates/oakcommon/src/displayicc.rs +++ b/crates/oak-common/src/displayicc.rs @@ -17,7 +17,7 @@ //! Platform display ICC profile lookup for color management. //! //! Resolves the filesystem path of the main display's ICC profile for the -//! OCIO pipeline (`oakrender::color::ColorProcessor::create_display_icc`). +//! OCIO pipeline (`oak_render::color::ColorProcessor::create_display_icc`). //! `system_display_icc()` is the single entry point; it honors the //! `OAK_DISPLAY_ICC` override first, then asks the platform: //! diff --git a/crates/oakcommon/src/error.rs b/crates/oak-common/src/error.rs similarity index 100% rename from crates/oakcommon/src/error.rs rename to crates/oak-common/src/error.rs diff --git a/crates/oakcommon/src/ffmpegutils.rs b/crates/oak-common/src/ffmpegutils.rs similarity index 100% rename from crates/oakcommon/src/ffmpegutils.rs rename to crates/oak-common/src/ffmpegutils.rs diff --git a/crates/oakcommon/src/filefunctions.rs b/crates/oak-common/src/filefunctions.rs similarity index 100% rename from crates/oakcommon/src/filefunctions.rs rename to crates/oak-common/src/filefunctions.rs diff --git a/crates/oakcommon/src/lib.rs b/crates/oak-common/src/lib.rs similarity index 100% rename from crates/oakcommon/src/lib.rs rename to crates/oak-common/src/lib.rs diff --git a/crates/oakcommon/src/miscutils.rs b/crates/oak-common/src/miscutils.rs similarity index 100% rename from crates/oakcommon/src/miscutils.rs rename to crates/oak-common/src/miscutils.rs diff --git a/crates/oakcommon/src/ocioutils.rs b/crates/oak-common/src/ocioutils.rs similarity index 100% rename from crates/oakcommon/src/ocioutils.rs rename to crates/oak-common/src/ocioutils.rs diff --git a/crates/oakcommon/src/oiioutils.rs b/crates/oak-common/src/oiioutils.rs similarity index 99% rename from crates/oakcommon/src/oiioutils.rs rename to crates/oak-common/src/oiioutils.rs index bb6313ed3..a73a929be 100644 --- a/crates/oakcommon/src/oiioutils.rs +++ b/crates/oak-common/src/oiioutils.rs @@ -23,7 +23,7 @@ //! tables (per-channel bit depth → OIIO `TypeDesc::BASETYPE` code), with the //! half-float case pinned from the frozen OIIO table since `image` 0.25 has //! no f16 sample type. Aspect-ratio conversion uses -//! `oakcore_rs::Rational::from_double`, the C++ `Rational::from_double` +//! `oak_core::Rational::from_double`, the C++ `Rational::from_double` //! port of FFmpeg's `av_d2q` (kept as a hand-written port rather than //! pulling in `ffmpeg-next` — see README decision 6). 32-bit float image I/O //! is provided by [`F32Image`] / [`read_image_f32`] / [`write_image_f32`], @@ -32,7 +32,7 @@ use crate::error::{Error, Result}; use crate::ocioutils::PixelFormat; use image::{ExtendedColorType, ImageBuffer, Rgb, Rgba}; -use oakcore_rs::Rational; +use oak_core::Rational; /// OIIO base type codes, matching `OIIO::TypeDesc::BASETYPE`. /// diff --git a/crates/oakcommon/src/qtutils.rs b/crates/oak-common/src/qtutils.rs similarity index 100% rename from crates/oakcommon/src/qtutils.rs rename to crates/oak-common/src/qtutils.rs diff --git a/crates/oakcommon/src/subtitleparams.rs b/crates/oak-common/src/subtitleparams.rs similarity index 99% rename from crates/oakcommon/src/subtitleparams.rs rename to crates/oak-common/src/subtitleparams.rs index 0ba751110..8c81fa7a7 100644 --- a/crates/oakcommon/src/subtitleparams.rs +++ b/crates/oak-common/src/subtitleparams.rs @@ -1155,14 +1155,14 @@ mod tests { (7, 3), (i32::MAX, 1), ] { - let r = oakcore_rs::Rational::new(n as i64, d as i64); + let r = oak_core::Rational::new(n as i64, d as i64); assert_eq!( rational_reduce(n, d), (r.numerator() as i32, r.denominator() as i32) ); } for s in ["1/2", "7", "4/2", "junk", "a/b", "1/2/3", ""] { - let r = oakcore_rs::Rational::from_string(s); + let r = oak_core::Rational::from_string(s); assert_eq!( rational_from_string(s), (r.numerator() as i32, r.denominator() as i32), diff --git a/crates/oakcommon/src/videoparams.rs b/crates/oak-common/src/videoparams.rs similarity index 99% rename from crates/oakcommon/src/videoparams.rs rename to crates/oak-common/src/videoparams.rs index d0277e61a..af86bbf68 100644 --- a/crates/oakcommon/src/videoparams.rs +++ b/crates/oak-common/src/videoparams.rs @@ -2278,7 +2278,7 @@ mod tests { #[test] fn rational_helpers_match_oakcore() { - // The hand-rolled tuple rationals must agree with oakcore_rs::Rational, + // The hand-rolled tuple rationals must agree with oak_core::Rational, // the canonical port of the C++ Rational. for (n, d) in [ (2i32, 4i32), @@ -2289,14 +2289,14 @@ mod tests { (7, 3), (100, 10), ] { - let r = oakcore_rs::Rational::new(n as i64, d as i64); + let r = oak_core::Rational::new(n as i64, d as i64); assert_eq!( make_rational(n, d), (r.numerator() as i32, r.denominator() as i32) ); } for s in ["1/2", "7", "4/2", "junk", "a/b", "1/2/3", "-6/3"] { - let r = oakcore_rs::Rational::from_string(s); + let r = oak_core::Rational::from_string(s); assert_eq!( rational_from_string(s), (r.numerator() as i32, r.denominator() as i32), @@ -2320,9 +2320,9 @@ mod tests { 1, ); vp.set_start_time(11); - let tb = oakcore_rs::Rational::new(1001, 30000); + let tb = oak_core::Rational::new(1001, 30000); for (n, d) in [(1i32, 1i32), (1, 2), (24000, 1001), (-3, 1), (0, 1)] { - let expected = tb.time_to_timestamp(oakcore_rs::Rational::new(n as i64, d as i64)) + 11; + let expected = tb.time_to_timestamp(oak_core::Rational::new(n as i64, d as i64)) + 11; assert_eq!(vp.time_in_timebase_units(n, d), Some(expected)); } } diff --git a/crates/oakcommon/src/xmlutils.rs b/crates/oak-common/src/xmlutils.rs similarity index 100% rename from crates/oakcommon/src/xmlutils.rs rename to crates/oak-common/src/xmlutils.rs diff --git a/crates/oakcommon/tests/contract.rs b/crates/oak-common/tests/contract.rs similarity index 92% rename from crates/oakcommon/tests/contract.rs rename to crates/oak-common/tests/contract.rs index b32712658..700bf0f47 100644 --- a/crates/oakcommon/tests/contract.rs +++ b/crates/oak-common/tests/contract.rs @@ -22,14 +22,14 @@ use std::mem::{align_of, size_of}; -use oakcommon::error::{ +use oak_common::error::{ OAKCOMMON_E_FAILED, OAKCOMMON_E_INVALID, OAKCOMMON_E_NOMEM, OAKCOMMON_E_NOT_FOUND, OAKCOMMON_E_STATE, OAKCOMMON_OK, }; -use oakcommon::ffmpegutils::{RGBA_CHANNEL_COUNT, RGB_CHANNEL_COUNT}; -use oakcommon::miscutils::{DropWorkflowBehavior, LoopMode, DECIBEL_MINIMUM}; -use oakcommon::ocioutils::PixelFormat; -use oakcommon::videoparams::{ColorRange, Interlacing, VideoType}; +use oak_common::ffmpegutils::{RGBA_CHANNEL_COUNT, RGB_CHANNEL_COUNT}; +use oak_common::miscutils::{DropWorkflowBehavior, LoopMode, DECIBEL_MINIMUM}; +use oak_common::ocioutils::PixelFormat; +use oak_common::videoparams::{ColorRange, Interlacing, VideoType}; /// Error codes must match `include/common/error.h`. #[test] diff --git a/crates/oakcommon/tests/real_ocio.rs b/crates/oak-common/tests/real_ocio.rs similarity index 98% rename from crates/oakcommon/tests/real_ocio.rs rename to crates/oak-common/tests/real_ocio.rs index 0c276032e..29a349e01 100644 --- a/crates/oakcommon/tests/real_ocio.rs +++ b/crates/oak-common/tests/real_ocio.rs @@ -23,9 +23,9 @@ //! variable first (the library reads it at config-load time). The image tests //! round-trip a small float TIFF through a temp file via the `image` crate. -use oakcommon::error::Error; -use oakcommon::ocioutils::OcioConfig; -use oakcommon::oiioutils::{read_image_f32, write_image_f32}; +use oak_common::error::Error; +use oak_common::ocioutils::OcioConfig; +use oak_common::oiioutils::{read_image_f32, write_image_f32}; /// Path to the project's OCIO config, relative to this crate's manifest dir. fn config_path() -> String { diff --git a/crates/oakcore/Cargo.lock b/crates/oak-core/Cargo.lock similarity index 100% rename from crates/oakcore/Cargo.lock rename to crates/oak-core/Cargo.lock diff --git a/crates/oakcore/Cargo.toml b/crates/oak-core/Cargo.toml similarity index 81% rename from crates/oakcore/Cargo.toml rename to crates/oak-core/Cargo.toml index cd8329c07..9fb042cdc 100644 --- a/crates/oakcore/Cargo.toml +++ b/crates/oak-core/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakcore-rs" -version = "0.1.0" +name = "oak-core" +version.workspace = true edition = "2021" description = "Rust value types mirroring oakcore (Rational, TimeRange, format enums)" license = "GPL-3.0-or-later" diff --git a/crates/oakcore/README.md b/crates/oak-core/README.md similarity index 100% rename from crates/oakcore/README.md rename to crates/oak-core/README.md diff --git a/crates/oakcore/src/handle.rs b/crates/oak-core/src/handle.rs similarity index 100% rename from crates/oakcore/src/handle.rs rename to crates/oak-core/src/handle.rs diff --git a/crates/oakcore/src/lib.rs b/crates/oak-core/src/lib.rs similarity index 100% rename from crates/oakcore/src/lib.rs rename to crates/oak-core/src/lib.rs diff --git a/crates/oakcore/src/rational.rs b/crates/oak-core/src/rational.rs similarity index 100% rename from crates/oakcore/src/rational.rs rename to crates/oak-core/src/rational.rs diff --git a/crates/oakcore/src/samplefmt.rs b/crates/oak-core/src/samplefmt.rs similarity index 100% rename from crates/oakcore/src/samplefmt.rs rename to crates/oak-core/src/samplefmt.rs diff --git a/crates/oakcore/src/timerange.rs b/crates/oak-core/src/timerange.rs similarity index 100% rename from crates/oakcore/src/timerange.rs rename to crates/oak-core/src/timerange.rs diff --git a/crates/oakcore/tests/core_test.rs b/crates/oak-core/tests/core_test.rs similarity index 99% rename from crates/oakcore/tests/core_test.rs rename to crates/oak-core/tests/core_test.rs index 8941b06fd..4548e66e8 100644 --- a/crates/oakcore/tests/core_test.rs +++ b/crates/oak-core/tests/core_test.rs @@ -16,7 +16,7 @@ //! oakcore-rs contract tests. The oracle is the C++ oakcore behavior: /// every case below names the C++ semantic it pins down. -use oakcore_rs::{PixelFormat, Rational, SampleFormat, TimeRange, TimeRangeList}; +use oak_core::{PixelFormat, Rational, SampleFormat, TimeRange, TimeRangeList}; /// Construction reduces (2/4 -> 1/2), normalizes sign (1/-2 -> -1/2), /// and 0/0 is the null sentinel. C++: Rational ctor + reduced(). @@ -406,7 +406,7 @@ fn additional_edge_cases() { /// high-precision retry path. #[test] fn rational_from_double() { - use oakcore_rs::Rational; + use oak_core::Rational; assert!(Rational::from_double(f64::NAN).is_nan()); assert!(Rational::from_double(1e300).is_nan()); assert!(Rational::from_double(-1e300).is_nan()); diff --git a/crates/oakffmpeg-link/Cargo.toml b/crates/oak-ffmpeg-link/Cargo.toml similarity index 89% rename from crates/oakffmpeg-link/Cargo.toml rename to crates/oak-ffmpeg-link/Cargo.toml index ee60e7e8a..fd91bb2e1 100644 --- a/crates/oakffmpeg-link/Cargo.toml +++ b/crates/oak-ffmpeg-link/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakffmpeg-link" -version = "0.1.0" +name = "oak-ffmpeg-link" +version.workspace = true edition = "2021" description = "Oak Video Editor internal link helper: transitive dependencies of a static FFmpeg (Rust)" license = "GPL-3.0-or-later" diff --git a/crates/oakffmpeg-link/build.rs b/crates/oak-ffmpeg-link/build.rs similarity index 100% rename from crates/oakffmpeg-link/build.rs rename to crates/oak-ffmpeg-link/build.rs diff --git a/crates/oakffmpeg-link/src/lib.rs b/crates/oak-ffmpeg-link/src/lib.rs similarity index 100% rename from crates/oakffmpeg-link/src/lib.rs rename to crates/oak-ffmpeg-link/src/lib.rs diff --git a/crates/oaknode/COVERAGE.md b/crates/oak-node/COVERAGE.md similarity index 100% rename from crates/oaknode/COVERAGE.md rename to crates/oak-node/COVERAGE.md diff --git a/crates/oaknode/Cargo.lock b/crates/oak-node/Cargo.lock similarity index 100% rename from crates/oaknode/Cargo.lock rename to crates/oak-node/Cargo.lock diff --git a/crates/oaknode/Cargo.toml b/crates/oak-node/Cargo.toml similarity index 68% rename from crates/oaknode/Cargo.toml rename to crates/oak-node/Cargo.toml index dbacc1ec3..facf9464a 100644 --- a/crates/oaknode/Cargo.toml +++ b/crates/oak-node/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oaknode" -version = "0.1.0" +name = "oak-node" +version.workspace = true edition = "2021" description = "Oak Video Editor node graph engine (Rust)" license = "GPL-3.0-or-later" @@ -9,10 +9,10 @@ license = "GPL-3.0-or-later" crate-type = ["staticlib", "rlib"] [dependencies] -oakcore-rs = { path = "../oakcore" } -oakcommon = { path = "../oakcommon" } -oakundo = { path = "../oakundo" } -oakcodec = { path = "../oakcodec" } +oak-core = { path = "../oak-core" } +oak-common = { path = "../oak-common" } + oak-undo = { path = "../oak-undo" } +oak-codec = { path = "../oak-codec" } thiserror = "2" [dev-dependencies] diff --git a/crates/oaknode/README.md b/crates/oak-node/README.md similarity index 100% rename from crates/oaknode/README.md rename to crates/oak-node/README.md diff --git a/crates/oaknode/src/block.rs b/crates/oak-node/src/block.rs similarity index 99% rename from crates/oaknode/src/block.rs rename to crates/oak-node/src/block.rs index 4e27fbce8..1612a98de 100644 --- a/crates/oaknode/src/block.rs +++ b/crates/oak-node/src/block.rs @@ -17,7 +17,7 @@ //! Blocks (C++ `Block`, `ClipBlock`, `GapBlock`, `TransitionBlock`). //! `// CPP-PARITY: src/node/src/block/*`. -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; use crate::id::NodeId; use crate::input::Input; diff --git a/crates/oaknode/src/colormanager.rs b/crates/oak-node/src/colormanager.rs similarity index 100% rename from crates/oaknode/src/colormanager.rs rename to crates/oak-node/src/colormanager.rs diff --git a/crates/oaknode/src/error.rs b/crates/oak-node/src/error.rs similarity index 100% rename from crates/oaknode/src/error.rs rename to crates/oak-node/src/error.rs diff --git a/crates/oaknode/src/factory.rs b/crates/oak-node/src/factory.rs similarity index 100% rename from crates/oaknode/src/factory.rs rename to crates/oak-node/src/factory.rs diff --git a/crates/oaknode/src/folder.rs b/crates/oak-node/src/folder.rs similarity index 100% rename from crates/oaknode/src/folder.rs rename to crates/oak-node/src/folder.rs diff --git a/crates/oaknode/src/footage.rs b/crates/oak-node/src/footage.rs similarity index 90% rename from crates/oaknode/src/footage.rs rename to crates/oak-node/src/footage.rs index d358e73bc..65988b6d5 100644 --- a/crates/oaknode/src/footage.rs +++ b/crates/oak-node/src/footage.rs @@ -38,7 +38,7 @@ pub struct StreamInfo { pub audio: Option, /// Duration in rational seconds (the longest stream wins; see /// [`FootageBehavior::duration`]). - pub duration: oakcore_rs::Rational, + pub duration: oak_core::Rational, } /// Footage behavior. @@ -59,10 +59,10 @@ pub struct FootageBehavior { pub proxy_preset_version: i32, /// Per-footage proxy generation params (C++ `custom_proxy_params_`; /// `None` = use the global config params). - pub custom_proxy_params: Option, + pub custom_proxy_params: Option, /// Source start time (timecode embedded in the media; C++ /// `source_start_time_`). - pub source_start_time: oakcore_rs::Rational, + pub source_start_time: oak_core::Rational, /// Whether [`Self::source_start_time`] is set. pub has_source_start_time: bool, /// File last-modified timestamp (ms since epoch). @@ -87,7 +87,7 @@ impl FootageBehavior { proxy_video_stream_index: -1, proxy_preset_version: 0, custom_proxy_params: None, - source_start_time: oakcore_rs::Rational::new(0, 1), + source_start_time: oak_core::Rational::new(0, 1), has_source_start_time: false, timestamp: 0, decoder: String::new(), @@ -106,7 +106,7 @@ impl FootageBehavior { // Direct probe through the oakcodec decoder registry (single-lib // unification; replaces the former `oakcodec_decoder_probe` C ABI // call). - let desc = oakcodec::decoder::receive_list_of_all_decoders() + let desc = oak_codec::decoder::receive_list_of_all_decoders() .into_iter() .find_map(|d| { let desc = d.probe(&self.filename, None)?; @@ -138,7 +138,7 @@ impl FootageBehavior { self.source_start_time = if self.has_source_start_time { desc.source_start_time() } else { - oakcore_rs::Rational::new(0, 1) + oak_core::Rational::new(0, 1) }; self.valid = true; Ok(()) @@ -175,8 +175,8 @@ impl FootageBehavior { } /// Duration of the longest stream (C++ `ViewerOutput::get_length`). - pub fn duration(&self) -> oakcore_rs::Rational { - let mut longest = oakcore_rs::Rational::new(0, 1); + pub fn duration(&self) -> oak_core::Rational { + let mut longest = oak_core::Rational::new(0, 1); for s in &self.streams { if s.duration > longest { longest = s.duration; @@ -186,8 +186,8 @@ impl FootageBehavior { } /// Video length (duration of the longest video stream). - pub fn video_length(&self) -> oakcore_rs::Rational { - let mut longest = oakcore_rs::Rational::new(0, 1); + pub fn video_length(&self) -> oak_core::Rational { + let mut longest = oak_core::Rational::new(0, 1); for s in self.streams.iter().filter(|s| s.is_video) { if s.duration > longest { longest = s.duration; @@ -246,7 +246,7 @@ impl FootageBehavior { /// Set the per-footage proxy generation params (C++ /// `set_custom_proxy_params`). - pub fn set_custom_proxy_params(&mut self, params: oakcodec::proxymanager::ProxyParams) { + pub fn set_custom_proxy_params(&mut self, params: oak_codec::proxymanager::ProxyParams) { self.custom_proxy_params = Some(params); } @@ -265,22 +265,22 @@ impl FootageBehavior { /// The proxy generation params to use for this footage: the custom /// params when set, otherwise the global config params (C++ /// `get_effective_proxy_params`). - pub fn effective_proxy_params(&self) -> oakcodec::proxymanager::ProxyParams { + pub fn effective_proxy_params(&self) -> oak_codec::proxymanager::ProxyParams { self.custom_proxy_params .clone() - .unwrap_or_else(oakcodec::proxymanager::ProxyManager::proxy_params_from_config) + .unwrap_or_else(oak_codec::proxymanager::ProxyManager::proxy_params_from_config) } /// Set the source start time (C++ `set_source_start_time`; the Rust /// probe records it, the serializer persists it). - pub fn set_source_start_time(&mut self, time: oakcore_rs::Rational) { + pub fn set_source_start_time(&mut self, time: oak_core::Rational) { self.source_start_time = time; self.has_source_start_time = true; } /// Clear the source start time (C++ `clear_source_start_time`). pub fn clear_source_start_time(&mut self) { - self.source_start_time = oakcore_rs::Rational::new(0, 1); + self.source_start_time = oak_core::Rational::new(0, 1); self.has_source_start_time = false; } @@ -364,11 +364,11 @@ impl NodeBehavior for FootageBehavior { writer.attribute("enabled", if self.proxy_enabled { "1" } else { "0" }); // The C++ writes the state name (footage.cpp save_custom); the // reader accepts both the name and the legacy numeric form. - let state = oakcodec::proxymanager::ProxyState::try_from(self.proxy_state) - .unwrap_or(oakcodec::proxymanager::ProxyState::Missing); + let state = oak_codec::proxymanager::ProxyState::try_from(self.proxy_state) + .unwrap_or(oak_codec::proxymanager::ProxyState::Missing); writer.attribute( "state", - &oakcodec::proxymanager::ProxyManager::proxy_state_to_string(state), + &oak_codec::proxymanager::ProxyManager::proxy_state_to_string(state), ); writer.attribute("stream", &self.proxy_video_stream_index.to_string()); writer.attribute("preset", &self.proxy_preset_version.to_string()); @@ -449,7 +449,7 @@ impl NodeBehavior for FootageBehavior { self.proxy_state = reader .attribute("state") .map(|v| { - oakcodec::proxymanager::ProxyManager::proxy_state_from_string(&v) + oak_codec::proxymanager::ProxyManager::proxy_state_from_string(&v) as i32 }) .unwrap_or(0); @@ -462,7 +462,7 @@ impl NodeBehavior for FootageBehavior { .and_then(|v| v.parse().ok()) .unwrap_or(0); if reader.attribute("custom").map(|v| v == "1").unwrap_or(false) { - let mut custom = oakcodec::proxymanager::ProxyParams::default(); + let mut custom = oak_codec::proxymanager::ProxyParams::default(); if let Some(v) = reader.attribute("pwidth").and_then(|v| v.parse().ok()) { custom.width = v; } @@ -508,7 +508,7 @@ impl NodeBehavior for FootageBehavior { ); if let (Some(num), Some(den)) = (num, den) { if den != 0 { - self.source_start_time = oakcore_rs::Rational::new(num, den); + self.source_start_time = oak_core::Rational::new(num, den); self.has_source_start_time = true; } } @@ -527,8 +527,8 @@ impl NodeBehavior for FootageBehavior { .unwrap_or(false); let duration = reader .attribute("duration") - .map(|v| oakcore_rs::Rational::from_string(&v)) - .unwrap_or_else(|| oakcore_rs::Rational::new(0, 1)); + .map(|v| oak_core::Rational::from_string(&v)) + .unwrap_or_else(|| oak_core::Rational::new(0, 1)); let mut video = None; let mut audio = None; while reader.next_start_element() { @@ -545,9 +545,9 @@ impl NodeBehavior for FootageBehavior { .unwrap_or(0), frame_rate: reader .attribute("framerate") - .map(|v| oakcore_rs::Rational::from_string(&v)) + .map(|v| oak_core::Rational::from_string(&v)) .unwrap_or_else(|| { - oakcore_rs::Rational::new(0, 1) + oak_core::Rational::new(0, 1) }), pixel_format: reader .attribute("pixelformat") @@ -627,7 +627,7 @@ impl NodeBehavior for FootageBehavior { /// them anyway). The rows are sorted by container index, restoring the /// probe order the per-kind ordinal loops group away. fn streams_from_description( - desc: &oakcodec::footagedescription::FootageDescription, + desc: &oak_codec::footagedescription::FootageDescription, ) -> Vec { let mut streams = Vec::new(); for i in 0..desc.video_stream_count() { @@ -641,7 +641,7 @@ fn streams_from_description( video: Some(VideoParams { width: vp.width(), height: vp.height(), - frame_rate: oakcore_rs::Rational::new(num as i64, den as i64), + frame_rate: oak_core::Rational::new(num as i64, den as i64), pixel_format: vp.format().code(), channels: vp.channel_count(), }), @@ -670,7 +670,7 @@ fn streams_from_description( } /// View a proxy param's NUL-terminated preset bytes as a `&str`. -fn preset_str(params: &oakcodec::proxymanager::ProxyParams) -> &str { +fn preset_str(params: &oak_codec::proxymanager::ProxyParams) -> &str { let end = params .preset .iter() @@ -680,7 +680,7 @@ fn preset_str(params: &oakcodec::proxymanager::ProxyParams) -> &str { } /// View a proxy param's NUL-terminated extension bytes as a `&str`. -fn extension_str(params: &oakcodec::proxymanager::ProxyParams) -> &str { +fn extension_str(params: &oak_codec::proxymanager::ProxyParams) -> &str { let end = params .extension .iter() @@ -692,11 +692,11 @@ fn extension_str(params: &oakcodec::proxymanager::ProxyParams) -> &str { /// A stream duration in timebase ticks as rational seconds. `0/1` when /// the duration or the timebase is unusable (FFmpeg reports /// `AV_NOPTS_VALUE` for streams without a duration). -fn stream_duration_seconds(duration: i64, time_base: (i32, i32)) -> oakcore_rs::Rational { +fn stream_duration_seconds(duration: i64, time_base: (i32, i32)) -> oak_core::Rational { if duration <= 0 || time_base.0 <= 0 || time_base.1 <= 0 { - return oakcore_rs::Rational::new(0, 1); + return oak_core::Rational::new(0, 1); } - oakcore_rs::Rational::new( + oak_core::Rational::new( duration.saturating_mul(time_base.0 as i64), time_base.1 as i64, ) @@ -705,13 +705,13 @@ fn stream_duration_seconds(duration: i64, time_base: (i32, i32)) -> oakcore_rs:: #[cfg(test)] mod tests { use super::*; - use oakcodec::footagedescription::{FootageDescription, StreamEntry}; + use oak_codec::footagedescription::{FootageDescription, StreamEntry}; fn video_entry(stream_index: i32, duration: i64) -> StreamEntry { - let mut vp = oakcommon::videoparams::VideoParams::new_basic( + let mut vp = oak_common::videoparams::VideoParams::new_basic( 1920, 1080, - oakcommon::ocioutils::PixelFormat::F32, + oak_common::ocioutils::PixelFormat::F32, 4, 1, 1, @@ -726,7 +726,7 @@ mod tests { } fn audio_entry(stream_index: i32, duration: i64) -> StreamEntry { - StreamEntry::Audio(oakcodec::audioparams::AudioParams { + StreamEntry::Audio(oak_codec::audioparams::AudioParams { sample_rate: 48000, channel_layout: 0x3, format: 0, @@ -756,28 +756,28 @@ mod tests { assert_eq!(a.sample_rate, 48000); assert_eq!(a.channel_layout, 0x3); // 480000 ticks at 1/48000 = 10 seconds. - assert_eq!(audio.duration, oakcore_rs::Rational::new(10, 1)); + assert_eq!(audio.duration, oak_core::Rational::new(10, 1)); let v = video.video.expect("video params"); assert_eq!(v.width, 1920); assert_eq!(v.height, 1080); - assert_eq!(v.frame_rate, oakcore_rs::Rational::new(30000, 1001)); - assert_eq!(v.pixel_format, oakcommon::ocioutils::PixelFormat::F32.code()); + assert_eq!(v.frame_rate, oak_core::Rational::new(30000, 1001)); + assert_eq!(v.pixel_format, oak_common::ocioutils::PixelFormat::F32.code()); // 300000 ticks at 1/30000 = 10 seconds. - assert_eq!(video.duration, oakcore_rs::Rational::new(10, 1)); + assert_eq!(video.duration, oak_core::Rational::new(10, 1)); } #[test] fn conversion_skips_subtitles_and_unusable_durations() { let mut desc = FootageDescription::new("ffmpeg"); desc.push_stream(video_entry(0, i64::MIN)); // AV_NOPTS_VALUE - desc.push_stream(StreamEntry::Subtitle(oakcommon::subtitleparams::SubtitleParams::new())); + desc.push_stream(StreamEntry::Subtitle(oak_common::subtitleparams::SubtitleParams::new())); let streams = streams_from_description(&desc); assert_eq!(streams.len(), 1, "the subtitle stream is skipped"); assert_eq!( streams[0].duration, - oakcore_rs::Rational::new(0, 1), + oak_core::Rational::new(0, 1), "an unusable duration clamps to zero" ); } diff --git a/crates/oaknode/src/gizmo.rs b/crates/oak-node/src/gizmo.rs similarity index 99% rename from crates/oaknode/src/gizmo.rs rename to crates/oak-node/src/gizmo.rs index c5e35fbdd..e492dcda6 100644 --- a/crates/oaknode/src/gizmo.rs +++ b/crates/oak-node/src/gizmo.rs @@ -33,7 +33,7 @@ //! this by flattening the base-class fields into each concrete struct //! (the base fields are documented as such on each). -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; use crate::value::{AudioParams, NodeValue, VideoParams}; diff --git a/crates/oaknode/src/graph.rs b/crates/oak-node/src/graph.rs similarity index 100% rename from crates/oaknode/src/graph.rs rename to crates/oak-node/src/graph.rs diff --git a/crates/oaknode/src/handle.rs b/crates/oak-node/src/handle.rs similarity index 99% rename from crates/oaknode/src/handle.rs rename to crates/oak-node/src/handle.rs index bcab04732..449b9e7bc 100644 --- a/crates/oaknode/src/handle.rs +++ b/crates/oak-node/src/handle.rs @@ -67,7 +67,7 @@ struct RefBoxHeader { /// `docs/zh/plans/riir/single-lib.md`): one canonical /// `{ctx, addref, release, abi_version}` type in `oakcore-rs`, re-exported /// here so the facade's handle scaffolding stays source-compatible. -pub use oakcore_rs::handle::CHandle; +pub use oak_core::handle::CHandle; /// addref implementation: atomic +1. Shared by owned and facade boxes — /// a borrowed copy only extends the box's lifetime, never the borrowed diff --git a/crates/oaknode/src/id.rs b/crates/oak-node/src/id.rs similarity index 100% rename from crates/oaknode/src/id.rs rename to crates/oak-node/src/id.rs diff --git a/crates/oaknode/src/input.rs b/crates/oak-node/src/input.rs similarity index 100% rename from crates/oaknode/src/input.rs rename to crates/oak-node/src/input.rs diff --git a/crates/oaknode/src/keyframe.rs b/crates/oak-node/src/keyframe.rs similarity index 99% rename from crates/oaknode/src/keyframe.rs rename to crates/oak-node/src/keyframe.rs index 25f58dc89..518158e24 100644 --- a/crates/oaknode/src/keyframe.rs +++ b/crates/oak-node/src/keyframe.rs @@ -23,7 +23,7 @@ //! component), a Rust track holds whole values; vector/color values //! interpolate component-wise. -use oakcore_rs::Rational; +use oak_core::Rational; use crate::value::{NodeValue, ValueType}; diff --git a/crates/oaknode/src/lib.rs b/crates/oak-node/src/lib.rs similarity index 100% rename from crates/oaknode/src/lib.rs rename to crates/oak-node/src/lib.rs diff --git a/crates/oaknode/src/node.rs b/crates/oak-node/src/node.rs similarity index 99% rename from crates/oaknode/src/node.rs rename to crates/oak-node/src/node.rs index 4d031a0ca..11df35524 100644 --- a/crates/oaknode/src/node.rs +++ b/crates/oak-node/src/node.rs @@ -19,7 +19,7 @@ //! Rust home; this file carries the virtual surface ([`NodeBehavior`]) //! and the shared data ([`NodeCore`]). -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; use crate::id::NodeId; use crate::input::{Input, ValueHint}; @@ -337,7 +337,7 @@ impl NodeCore { &self, id: &str, element: i32, - time: oakcore_rs::Rational, + time: oak_core::Rational, ) -> crate::value::NodeValue { match self.keyframe_track(id, element) { Some(track) if !track.keys().is_empty() => track diff --git a/crates/oaknode/src/nodes/blur.rs b/crates/oak-node/src/nodes/blur.rs similarity index 99% rename from crates/oaknode/src/nodes/blur.rs rename to crates/oak-node/src/nodes/blur.rs index 81fbab92c..1bc1265ec 100644 --- a/crates/oaknode/src/nodes/blur.rs +++ b/crates/oak-node/src/nodes/blur.rs @@ -329,7 +329,7 @@ impl NodeBehavior for BlurFilterNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -554,7 +554,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/chromakey.rs b/crates/oak-node/src/nodes/chromakey.rs similarity index 99% rename from crates/oaknode/src/nodes/chromakey.rs rename to crates/oak-node/src/nodes/chromakey.rs index 5841e6ee3..7de778aa8 100644 --- a/crates/oaknode/src/nodes/chromakey.rs +++ b/crates/oak-node/src/nodes/chromakey.rs @@ -289,7 +289,7 @@ impl NodeBehavior for ChromaKeyNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -466,7 +466,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/colordifferencekey.rs b/crates/oak-node/src/nodes/colordifferencekey.rs similarity index 99% rename from crates/oaknode/src/nodes/colordifferencekey.rs rename to crates/oak-node/src/nodes/colordifferencekey.rs index 36d68c75a..3acc481d1 100644 --- a/crates/oaknode/src/nodes/colordifferencekey.rs +++ b/crates/oak-node/src/nodes/colordifferencekey.rs @@ -190,7 +190,7 @@ impl NodeBehavior for ColorDifferenceKeyNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -300,7 +300,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/cornerpindistortnode.rs b/crates/oak-node/src/nodes/cornerpindistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/cornerpindistortnode.rs rename to crates/oak-node/src/nodes/cornerpindistortnode.rs index a74ae606b..cae6a3916 100644 --- a/crates/oaknode/src/nodes/cornerpindistortnode.rs +++ b/crates/oak-node/src/nodes/cornerpindistortnode.rs @@ -291,7 +291,7 @@ impl NodeBehavior for CornerPinDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -497,7 +497,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/cropdistortnode.rs b/crates/oak-node/src/nodes/cropdistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/cropdistortnode.rs rename to crates/oak-node/src/nodes/cropdistortnode.rs index ec49f0acf..5812d3ad5 100644 --- a/crates/oaknode/src/nodes/cropdistortnode.rs +++ b/crates/oak-node/src/nodes/cropdistortnode.rs @@ -181,7 +181,7 @@ impl NodeBehavior for CropDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -399,7 +399,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/despill.rs b/crates/oak-node/src/nodes/despill.rs similarity index 99% rename from crates/oaknode/src/nodes/despill.rs rename to crates/oak-node/src/nodes/despill.rs index 27c675f96..a915de4ea 100644 --- a/crates/oaknode/src/nodes/despill.rs +++ b/crates/oak-node/src/nodes/despill.rs @@ -180,7 +180,7 @@ impl NodeBehavior for DespillNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -268,7 +268,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/displaytransform.rs b/crates/oak-node/src/nodes/displaytransform.rs similarity index 99% rename from crates/oaknode/src/nodes/displaytransform.rs rename to crates/oak-node/src/nodes/displaytransform.rs index 26a8301c4..da933bc69 100644 --- a/crates/oaknode/src/nodes/displaytransform.rs +++ b/crates/oak-node/src/nodes/displaytransform.rs @@ -198,7 +198,7 @@ impl NodeBehavior for DisplayTransformNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { self.base.value(core, inputs, time, table); @@ -280,7 +280,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn node() -> DisplayTransformNode { DisplayTransformNode { diff --git a/crates/oaknode/src/nodes/dropshadowfilter.rs b/crates/oak-node/src/nodes/dropshadowfilter.rs similarity index 99% rename from crates/oaknode/src/nodes/dropshadowfilter.rs rename to crates/oak-node/src/nodes/dropshadowfilter.rs index c6ac1c2e6..6ccc1b505 100644 --- a/crates/oaknode/src/nodes/dropshadowfilter.rs +++ b/crates/oak-node/src/nodes/dropshadowfilter.rs @@ -230,7 +230,7 @@ impl NodeBehavior for DropShadowFilter { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { if !matches!( @@ -332,7 +332,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/flipdistortnode.rs b/crates/oak-node/src/nodes/flipdistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/flipdistortnode.rs rename to crates/oak-node/src/nodes/flipdistortnode.rs index 8e4b6cdb7..65e207cd6 100644 --- a/crates/oaknode/src/nodes/flipdistortnode.rs +++ b/crates/oak-node/src/nodes/flipdistortnode.rs @@ -109,7 +109,7 @@ impl NodeBehavior for FlipDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -190,7 +190,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/generatorwithmerge.rs b/crates/oak-node/src/nodes/generatorwithmerge.rs similarity index 100% rename from crates/oaknode/src/nodes/generatorwithmerge.rs rename to crates/oak-node/src/nodes/generatorwithmerge.rs diff --git a/crates/oaknode/src/nodes/group.rs b/crates/oak-node/src/nodes/group.rs similarity index 100% rename from crates/oaknode/src/nodes/group.rs rename to crates/oak-node/src/nodes/group.rs diff --git a/crates/oaknode/src/nodes/mask.rs b/crates/oak-node/src/nodes/mask.rs similarity index 99% rename from crates/oaknode/src/nodes/mask.rs rename to crates/oak-node/src/nodes/mask.rs index a3aa465c4..92ee7bc60 100644 --- a/crates/oaknode/src/nodes/mask.rs +++ b/crates/oak-node/src/nodes/mask.rs @@ -327,7 +327,7 @@ impl NodeBehavior for MaskDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -470,7 +470,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/math.rs b/crates/oak-node/src/nodes/math.rs similarity index 97% rename from crates/oaknode/src/nodes/math.rs rename to crates/oak-node/src/nodes/math.rs index 8e06fee19..87ca792f6 100644 --- a/crates/oaknode/src/nodes/math.rs +++ b/crates/oak-node/src/nodes/math.rs @@ -119,7 +119,7 @@ impl NodeBehavior for MathNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let a = inputs @@ -164,7 +164,7 @@ impl NodeBehavior for MathNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - range: oakcore_rs::TimeRange, + range: oak_core::TimeRange, output: &mut crate::value::SampleBuffer, ) { let _ = range; @@ -282,7 +282,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn row(values: &[(&str, NodeValue)]) -> crate::value::NodeValueRow { values @@ -372,7 +372,7 @@ mod tests { let (mut core, behavior) = create(); core.set_standard_value(METHOD_INPUT, -1, NodeValue::Combo(2)); // Multiply let mut buf = crate::value::SampleBuffer { - format: oakcore_rs::SampleFormat::F32Planar, + format: oak_core::SampleFormat::F32Planar, channels: 1, sample_count: 2, data: vec![0u8; 8], @@ -384,7 +384,7 @@ mod tests { (PARAM_B_INPUT, NodeValue::Float(3.0)), ]); let mut out = crate::value::SampleBuffer { - format: oakcore_rs::SampleFormat::F32Planar, + format: oak_core::SampleFormat::F32Planar, channels: 1, sample_count: 2, data: vec![0u8; 8], @@ -392,7 +392,7 @@ mod tests { behavior.process_samples( &core, &inputs, - oakcore_rs::TimeRange::new(Rational::new(0, 1), Rational::new(2, 1)), + oak_core::TimeRange::new(Rational::new(0, 1), Rational::new(2, 1)), &mut out, ); assert_eq!(out.sample_value(0, 0), 3.0); diff --git a/crates/oaknode/src/nodes/mathbase.rs b/crates/oak-node/src/nodes/mathbase.rs similarity index 99% rename from crates/oaknode/src/nodes/mathbase.rs rename to crates/oak-node/src/nodes/mathbase.rs index beae16739..f4efa06cf 100644 --- a/crates/oaknode/src/nodes/mathbase.rs +++ b/crates/oak-node/src/nodes/mathbase.rs @@ -729,9 +729,9 @@ fn perform_all_f32(operation: Operation, a: f32, b: f32) -> f32 { /// rationals; power is unsupported and returns `a` unchanged. fn add_sub_mult_div_rational( operation: Operation, - a: oakcore_rs::Rational, - b: oakcore_rs::Rational, -) -> oakcore_rs::Rational { + a: oak_core::Rational, + b: oak_core::Rational, +) -> oak_core::Rational { match operation { Operation::Add => a + b, Operation::Subtract => a - b, @@ -957,7 +957,7 @@ impl ValueType { mod tests { use super::*; use crate::value::{NodeValueTable, SampleBuffer}; - use oakcore_rs::{Rational, SampleFormat}; + use oak_core::{Rational, SampleFormat}; fn table(values: Vec) -> NodeValueTable { let mut t = NodeValueTable::default(); @@ -1462,14 +1462,14 @@ mod tests { let mut core = NodeCore::new(); core.keyframe_track_mut("num_in", -1) .set_key(crate::keyframe::Keyframe { - time: oakcore_rs::Rational::new(0, 1), + time: oak_core::Rational::new(0, 1), value: NodeValue::Float(2.0), interpolation: crate::keyframe::Interpolation::Linear, bezier_in: (0.0, 0.0), bezier_out: (0.0, 0.0), }); let buf = crate::value::SampleBuffer { - format: oakcore_rs::SampleFormat::F32Planar, + format: oak_core::SampleFormat::F32Planar, channels: 1, sample_count: 1, data: vec![0u8; 4], @@ -1557,7 +1557,7 @@ mod tests { #[test] fn value_rational_arithmetic_all_ops() { - use oakcore_rs::Rational; + use oak_core::Rational; for (op, a, b, expect) in [ ( Operation::Add, @@ -1641,7 +1641,7 @@ mod tests { #[test] fn process_samples_falls_back_when_param_a_not_scalar() { let input = crate::value::SampleBuffer { - format: oakcore_rs::SampleFormat::F32Planar, + format: oak_core::SampleFormat::F32Planar, channels: 1, sample_count: 1, data: vec![0u8; 4], @@ -1699,7 +1699,7 @@ mod tests { fn is_scalar_checks() { assert!(is_scalar(Some(&NodeValue::Float(1.0)))); assert!(is_scalar(Some(&NodeValue::Rational( - oakcore_rs::Rational::new(1, 2) + oak_core::Rational::new(1, 2) )))); assert!(!is_scalar(Some(&NodeValue::Samples( crate::value::SampleBuffer::default() diff --git a/crates/oaknode/src/nodes/matrix.rs b/crates/oak-node/src/nodes/matrix.rs similarity index 98% rename from crates/oaknode/src/nodes/matrix.rs rename to crates/oak-node/src/nodes/matrix.rs index f83880f8b..a13569776 100644 --- a/crates/oaknode/src/nodes/matrix.rs +++ b/crates/oak-node/src/nodes/matrix.rs @@ -99,7 +99,7 @@ impl NodeBehavior for MatrixGenerator { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let mat = MatrixGenerator::generate_matrix( @@ -150,7 +150,7 @@ impl MatrixGenerator { pub fn generate_matrix( row: &crate::value::NodeValueRow, core: &NodeCore, - time: oakcore_rs::Rational, + time: oak_core::Rational, ignore_anchor: bool, ignore_position: bool, ignore_scale: bool, @@ -264,7 +264,7 @@ fn matrix_rotate_z(m: [f64; 16], degrees: f64) -> [f64; 16] { fn row_vec2( row: &crate::value::NodeValueRow, core: &NodeCore, - time: oakcore_rs::Rational, + time: oak_core::Rational, id: &str, ) -> [f64; 2] { match row.get(id) { @@ -282,7 +282,7 @@ fn row_vec2( fn row_float( row: &crate::value::NodeValueRow, core: &NodeCore, - time: oakcore_rs::Rational, + time: oak_core::Rational, id: &str, ) -> f64 { match row.get(id) { @@ -296,7 +296,7 @@ fn row_float( fn row_bool( row: &crate::value::NodeValueRow, core: &NodeCore, - time: oakcore_rs::Rational, + time: oak_core::Rational, id: &str, ) -> bool { match row.get(id) { @@ -382,7 +382,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/merge.rs b/crates/oak-node/src/nodes/merge.rs similarity index 99% rename from crates/oaknode/src/nodes/merge.rs rename to crates/oak-node/src/nodes/merge.rs index d9e4a5465..a6d12e3e5 100644 --- a/crates/oaknode/src/nodes/merge.rs +++ b/crates/oak-node/src/nodes/merge.rs @@ -128,7 +128,7 @@ impl NodeBehavior for MergeNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -206,7 +206,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/mod.rs b/crates/oak-node/src/nodes/mod.rs similarity index 100% rename from crates/oaknode/src/nodes/mod.rs rename to crates/oak-node/src/nodes/mod.rs diff --git a/crates/oaknode/src/nodes/mosaicfilternode.rs b/crates/oak-node/src/nodes/mosaicfilternode.rs similarity index 99% rename from crates/oaknode/src/nodes/mosaicfilternode.rs rename to crates/oak-node/src/nodes/mosaicfilternode.rs index f1f792a2d..bc293618c 100644 --- a/crates/oaknode/src/nodes/mosaicfilternode.rs +++ b/crates/oak-node/src/nodes/mosaicfilternode.rs @@ -126,7 +126,7 @@ impl NodeBehavior for MosaicFilterNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { if !matches!( @@ -197,7 +197,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/multicamnode.rs b/crates/oak-node/src/nodes/multicamnode.rs similarity index 99% rename from crates/oaknode/src/nodes/multicamnode.rs rename to crates/oak-node/src/nodes/multicamnode.rs index 7043eb914..7a4047639 100644 --- a/crates/oaknode/src/nodes/multicamnode.rs +++ b/crates/oak-node/src/nodes/multicamnode.rs @@ -22,7 +22,7 @@ use crate::factory::NodeMeta; use crate::id::NodeId; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::Rational; +use oak_core::Rational; /// Current source selector input id (C++ `k_current_input`). Type: /// combo; default `0`; flags: static (not-connectable + @@ -390,7 +390,7 @@ mod tests { use crate::id::NodeId; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; /// A distinct, valid-looking node id for sequence connect tests. fn fake_id(n: u32) -> NodeId { diff --git a/crates/oaknode/src/nodes/noise.rs b/crates/oak-node/src/nodes/noise.rs similarity index 99% rename from crates/oaknode/src/nodes/noise.rs rename to crates/oak-node/src/nodes/noise.rs index 6d6dee8fb..559b7fc04 100644 --- a/crates/oaknode/src/nodes/noise.rs +++ b/crates/oak-node/src/nodes/noise.rs @@ -140,7 +140,7 @@ impl NodeBehavior for NoiseGeneratorNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { // C++ always pushes a job — with a base texture connected it runs @@ -211,7 +211,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/ociobase.rs b/crates/oak-node/src/nodes/ociobase.rs similarity index 98% rename from crates/oaknode/src/nodes/ociobase.rs rename to crates/oak-node/src/nodes/ociobase.rs index 4380c731a..8a937374e 100644 --- a/crates/oaknode/src/nodes/ociobase.rs +++ b/crates/oak-node/src/nodes/ociobase.rs @@ -108,7 +108,7 @@ impl OcioBase { &self, core: &NodeCore, inputs: &NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut NodeValueTable, ) { let _ = (core, time); @@ -171,7 +171,7 @@ mod tests { base.value( &NodeCore::new(), &NodeValueRow::default(), - oakcore_rs::Rational::new(0, 1), + oak_core::Rational::new(0, 1), &mut table, ); assert!(table.is_empty()); @@ -186,7 +186,7 @@ mod tests { base.value( &NodeCore::new(), &inputs, - oakcore_rs::Rational::new(0, 1), + oak_core::Rational::new(0, 1), &mut table, ); // Pass-through keeps the input texture value. @@ -205,7 +205,7 @@ mod tests { base.value( &NodeCore::new(), &inputs, - oakcore_rs::Rational::new(0, 1), + oak_core::Rational::new(0, 1), &mut table, ); assert!(table.get(ValueType::Texture).is_some()); diff --git a/crates/oaknode/src/nodes/ociogradingtransformlinear.rs b/crates/oak-node/src/nodes/ociogradingtransformlinear.rs similarity index 99% rename from crates/oaknode/src/nodes/ociogradingtransformlinear.rs rename to crates/oak-node/src/nodes/ociogradingtransformlinear.rs index 3360c666f..84a7d423d 100644 --- a/crates/oaknode/src/nodes/ociogradingtransformlinear.rs +++ b/crates/oak-node/src/nodes/ociogradingtransformlinear.rs @@ -304,7 +304,7 @@ impl NodeBehavior for OCIOGradingTransformLinearNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -528,7 +528,7 @@ mod tests { use super::*; use crate::keyframe::{Interpolation, Keyframe}; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn node() -> OCIOGradingTransformLinearNode { OCIOGradingTransformLinearNode { diff --git a/crates/oaknode/src/nodes/ociogradingtransformlog.rs b/crates/oak-node/src/nodes/ociogradingtransformlog.rs similarity index 99% rename from crates/oaknode/src/nodes/ociogradingtransformlog.rs rename to crates/oak-node/src/nodes/ociogradingtransformlog.rs index 3bca8ee2d..cb96ccbb8 100644 --- a/crates/oaknode/src/nodes/ociogradingtransformlog.rs +++ b/crates/oak-node/src/nodes/ociogradingtransformlog.rs @@ -315,7 +315,7 @@ impl NodeBehavior for OCIOGradingTransformLogNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -533,7 +533,7 @@ mod tests { use super::*; use crate::keyframe::{Interpolation, Keyframe}; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn node() -> OCIOGradingTransformLogNode { OCIOGradingTransformLogNode { diff --git a/crates/oaknode/src/nodes/ociolut.rs b/crates/oak-node/src/nodes/ociolut.rs similarity index 99% rename from crates/oaknode/src/nodes/ociolut.rs rename to crates/oak-node/src/nodes/ociolut.rs index 2fa801ac7..6569e5f53 100644 --- a/crates/oaknode/src/nodes/ociolut.rs +++ b/crates/oak-node/src/nodes/ociolut.rs @@ -304,7 +304,7 @@ impl NodeBehavior for OCIOLutNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { self.ensure_processor(core); @@ -421,7 +421,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn node() -> OCIOLutNode { OCIOLutNode { diff --git a/crates/oaknode/src/nodes/opacity.rs b/crates/oak-node/src/nodes/opacity.rs similarity index 99% rename from crates/oaknode/src/nodes/opacity.rs rename to crates/oak-node/src/nodes/opacity.rs index cbf60cc9b..9d9aac48b 100644 --- a/crates/oaknode/src/nodes/opacity.rs +++ b/crates/oak-node/src/nodes/opacity.rs @@ -143,7 +143,7 @@ impl NodeBehavior for OpacityEffect { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -255,7 +255,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/pan.rs b/crates/oak-node/src/nodes/pan.rs similarity index 98% rename from crates/oaknode/src/nodes/pan.rs rename to crates/oak-node/src/nodes/pan.rs index 0f33321e7..8a91c1645 100644 --- a/crates/oaknode/src/nodes/pan.rs +++ b/crates/oak-node/src/nodes/pan.rs @@ -86,7 +86,7 @@ impl NodeBehavior for PanNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let samples = match inputs.get(SAMPLES_INPUT) { @@ -130,7 +130,7 @@ impl NodeBehavior for PanNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - range: oakcore_rs::TimeRange, + range: oak_core::TimeRange, output: &mut crate::value::SampleBuffer, ) { let input = match inputs.get(SAMPLES_INPUT) { @@ -200,7 +200,7 @@ pub fn create() -> (NodeCore, Box) { mod tests { use super::*; use crate::value::NodeValueTable; - use oakcore_rs::{Rational, SampleFormat, TimeRange}; + use oak_core::{Rational, SampleFormat, TimeRange}; fn planar(channels: usize, count: usize, values: &[f64]) -> crate::value::SampleBuffer { let mut buf = crate::value::SampleBuffer { diff --git a/crates/oaknode/src/nodes/plugin.rs b/crates/oak-node/src/nodes/plugin.rs similarity index 98% rename from crates/oaknode/src/nodes/plugin.rs rename to crates/oak-node/src/nodes/plugin.rs index 990b6cb38..caa894c66 100644 --- a/crates/oaknode/src/nodes/plugin.rs +++ b/crates/oak-node/src/nodes/plugin.rs @@ -26,7 +26,7 @@ //! //! All per-plugin data (inputs, defaults, properties, labels) is //! discovered at runtime from the plugin descriptor by the oakplugin -//! discovery pass (`oakplugin::node_factory`), which builds the +//! discovery pass (`oak_plugin::node_factory`), which builds the //! [`NodeCore`] inputs, constructs [`PluginNode`]s and registers one //! factory entry per discovered plugin (the C++ //! `factory.cpp::register_plugin_nodes` + `PluginNode::PluginNode` @@ -37,7 +37,7 @@ use std::sync::{Arc, Mutex, OnceLock}; use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; /// Texture input id (C++ `plugin::k_texture_input`). Type: texture; /// no default. Only synthesized when the plugin declares clip inputs @@ -363,7 +363,7 @@ impl NodeBehavior for PluginNode { /// Constructor (C++ `PluginNode::PluginNode(instance)`): the real /// construction (instance creation + the OFX param/clip -> input /// translation) belongs to the oakplugin discovery pass -/// (`oakplugin::node_factory`), which registers one factory entry per +/// (`oak_plugin::node_factory`), which registers one factory entry per /// discovered plugin. This placeholder (null instance, empty cached /// metadata) stays for the static-registration surface and tests. pub fn create() -> (NodeCore, Box) { @@ -394,7 +394,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::{Rational, TimeRange}; + use oak_core::{Rational, TimeRange}; /// A plugin node with a non-null instance and cached metadata. fn node() -> PluginNode { @@ -526,7 +526,7 @@ mod tests { let n = node(); let core = NodeCore::new(); let input = crate::value::SampleBuffer { - format: oakcore_rs::SampleFormat::F32Planar, + format: oak_core::SampleFormat::F32Planar, channels: 2, sample_count: 3, // Planar layout: channel 0 plane [1, 2, 3], channel 1 plane @@ -548,7 +548,7 @@ mod tests { assert!(output.is_allocated()); assert_eq!(output.channels, 2); assert_eq!(output.sample_count, 3); - assert_eq!(output.format, oakcore_rs::SampleFormat::F32Planar); + assert_eq!(output.format, oak_core::SampleFormat::F32Planar); for c in 0..2 { for i in 0..3 { let expected = 1.0 + (c * 3 + i) as f64; @@ -562,7 +562,7 @@ mod tests { let n = node(); let core = NodeCore::new(); let mut output = crate::value::SampleBuffer { - format: oakcore_rs::SampleFormat::F32, + format: oak_core::SampleFormat::F32, channels: 1, sample_count: 2, data: vec![1.0f32, 2.0] diff --git a/crates/oaknode/src/nodes/polygon.rs b/crates/oak-node/src/nodes/polygon.rs similarity index 99% rename from crates/oaknode/src/nodes/polygon.rs rename to crates/oak-node/src/nodes/polygon.rs index f75019465..4e0f37148 100644 --- a/crates/oaknode/src/nodes/polygon.rs +++ b/crates/oak-node/src/nodes/polygon.rs @@ -116,7 +116,7 @@ impl NodeBehavior for PolygonGenerator { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -146,7 +146,7 @@ impl NodeBehavior for PolygonGenerator { &self, core: &NodeCore, frame: &mut crate::handle::CHandle, - time: oakcore_rs::Rational, + time: oak_core::Rational, ) { let _ = (core, frame, time); } @@ -267,7 +267,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/rippledistortnode.rs b/crates/oak-node/src/nodes/rippledistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/rippledistortnode.rs rename to crates/oak-node/src/nodes/rippledistortnode.rs index 876062446..0e9dd20b5 100644 --- a/crates/oaknode/src/nodes/rippledistortnode.rs +++ b/crates/oak-node/src/nodes/rippledistortnode.rs @@ -154,7 +154,7 @@ impl NodeBehavior for RippleDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -285,7 +285,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/shapenode.rs b/crates/oak-node/src/nodes/shapenode.rs similarity index 99% rename from crates/oaknode/src/nodes/shapenode.rs rename to crates/oak-node/src/nodes/shapenode.rs index a241603aa..12c466cca 100644 --- a/crates/oaknode/src/nodes/shapenode.rs +++ b/crates/oak-node/src/nodes/shapenode.rs @@ -201,7 +201,7 @@ impl NodeBehavior for ShapeNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -322,7 +322,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/shapenodebase.rs b/crates/oak-node/src/nodes/shapenodebase.rs similarity index 100% rename from crates/oaknode/src/nodes/shapenodebase.rs rename to crates/oak-node/src/nodes/shapenodebase.rs diff --git a/crates/oaknode/src/nodes/solid.rs b/crates/oak-node/src/nodes/solid.rs similarity index 98% rename from crates/oaknode/src/nodes/solid.rs rename to crates/oak-node/src/nodes/solid.rs index 55c5c7551..e8e2363e2 100644 --- a/crates/oaknode/src/nodes/solid.rs +++ b/crates/oak-node/src/nodes/solid.rs @@ -87,7 +87,7 @@ impl NodeBehavior for SolidGenerator { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, inputs, time); @@ -133,7 +133,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/stroke.rs b/crates/oak-node/src/nodes/stroke.rs similarity index 99% rename from crates/oaknode/src/nodes/stroke.rs rename to crates/oak-node/src/nodes/stroke.rs index 4a7c193fa..957d6edc7 100644 --- a/crates/oaknode/src/nodes/stroke.rs +++ b/crates/oak-node/src/nodes/stroke.rs @@ -184,7 +184,7 @@ impl NodeBehavior for StrokeFilterNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -286,7 +286,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/swirldistortnode.rs b/crates/oak-node/src/nodes/swirldistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/swirldistortnode.rs rename to crates/oak-node/src/nodes/swirldistortnode.rs index 8bb527559..3a6fa8096 100644 --- a/crates/oaknode/src/nodes/swirldistortnode.rs +++ b/crates/oak-node/src/nodes/swirldistortnode.rs @@ -134,7 +134,7 @@ impl NodeBehavior for SwirlDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -260,7 +260,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/textbackend.rs b/crates/oak-node/src/nodes/textbackend.rs similarity index 100% rename from crates/oaknode/src/nodes/textbackend.rs rename to crates/oak-node/src/nodes/textbackend.rs diff --git a/crates/oaknode/src/nodes/textv1.rs b/crates/oak-node/src/nodes/textv1.rs similarity index 99% rename from crates/oaknode/src/nodes/textv1.rs rename to crates/oak-node/src/nodes/textv1.rs index ad71b02c0..1ca669a84 100644 --- a/crates/oaknode/src/nodes/textv1.rs +++ b/crates/oak-node/src/nodes/textv1.rs @@ -30,7 +30,7 @@ use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::Rational; +use oak_core::Rational; use super::textbackend::{TextLayoutMode, TextLayoutRequest, TextLayoutSize}; @@ -330,7 +330,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/textv2.rs b/crates/oak-node/src/nodes/textv2.rs similarity index 99% rename from crates/oaknode/src/nodes/textv2.rs rename to crates/oak-node/src/nodes/textv2.rs index 91554be23..c1fa1a289 100644 --- a/crates/oaknode/src/nodes/textv2.rs +++ b/crates/oak-node/src/nodes/textv2.rs @@ -30,7 +30,7 @@ use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::Rational; +use oak_core::Rational; use super::textbackend::{TextLayoutMode, TextLayoutRequest, TextLayoutSize, TextRenderTransform}; @@ -435,7 +435,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/textv3.rs b/crates/oak-node/src/nodes/textv3.rs similarity index 99% rename from crates/oaknode/src/nodes/textv3.rs rename to crates/oak-node/src/nodes/textv3.rs index 58f367d30..430d35b53 100644 --- a/crates/oaknode/src/nodes/textv3.rs +++ b/crates/oak-node/src/nodes/textv3.rs @@ -30,7 +30,7 @@ use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::Rational; +use oak_core::Rational; use super::textbackend::{TextLayoutMode, TextLayoutRequest, TextLayoutSize, TextRenderTransform}; @@ -612,7 +612,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/threewaycolor.rs b/crates/oak-node/src/nodes/threewaycolor.rs similarity index 99% rename from crates/oaknode/src/nodes/threewaycolor.rs rename to crates/oak-node/src/nodes/threewaycolor.rs index 06d1aeb48..68cba577e 100644 --- a/crates/oaknode/src/nodes/threewaycolor.rs +++ b/crates/oak-node/src/nodes/threewaycolor.rs @@ -164,7 +164,7 @@ impl NodeBehavior for ThreeWayColorNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = (core, time); @@ -276,7 +276,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/tiledistortnode.rs b/crates/oak-node/src/nodes/tiledistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/tiledistortnode.rs rename to crates/oak-node/src/nodes/tiledistortnode.rs index 1bbcbf6ca..91b264e3d 100644 --- a/crates/oaknode/src/nodes/tiledistortnode.rs +++ b/crates/oak-node/src/nodes/tiledistortnode.rs @@ -229,7 +229,7 @@ impl NodeBehavior for TileDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -367,7 +367,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/timeformat.rs b/crates/oak-node/src/nodes/timeformat.rs similarity index 99% rename from crates/oaknode/src/nodes/timeformat.rs rename to crates/oak-node/src/nodes/timeformat.rs index 7ab51915c..ad424d449 100644 --- a/crates/oaknode/src/nodes/timeformat.rs +++ b/crates/oak-node/src/nodes/timeformat.rs @@ -22,7 +22,7 @@ use std::ffi::{c_char, c_int, c_long}; use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::Rational; +use oak_core::Rational; /// Time input id (C++ `k_time_input`). Type: float; no explicit default /// (seconds since the Unix epoch). @@ -379,7 +379,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; /// A `Tm` with just the calendar fields set (rest zeroed). fn tm(sec: i32, min: i32, hour: i32, mday: i32, mon: i32, year: i32) -> Tm { diff --git a/crates/oaknode/src/nodes/timeinput.rs b/crates/oak-node/src/nodes/timeinput.rs similarity index 98% rename from crates/oaknode/src/nodes/timeinput.rs rename to crates/oak-node/src/nodes/timeinput.rs index d8ca2841c..367a87ef8 100644 --- a/crates/oaknode/src/nodes/timeinput.rs +++ b/crates/oak-node/src/nodes/timeinput.rs @@ -20,7 +20,7 @@ use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::Rational; +use oak_core::Rational; /// Time input node. Emits the current time (in seconds) as a float. /// The C++ class has no own members (no inputs, no caches of its own), @@ -97,7 +97,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn value_pushes_current_time_as_float() { diff --git a/crates/oaknode/src/nodes/timeoffsetnode.rs b/crates/oak-node/src/nodes/timeoffsetnode.rs similarity index 99% rename from crates/oaknode/src/nodes/timeoffsetnode.rs rename to crates/oak-node/src/nodes/timeoffsetnode.rs index 1b1f8dbea..45f59507b 100644 --- a/crates/oaknode/src/nodes/timeoffsetnode.rs +++ b/crates/oak-node/src/nodes/timeoffsetnode.rs @@ -20,7 +20,7 @@ use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; /// Time offset input id (C++ `k_time_input`). Type: rational; default /// `Rational(0)`; flags: not-connectable; properties: `view = time slider`, @@ -251,7 +251,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/timeremap.rs b/crates/oak-node/src/nodes/timeremap.rs similarity index 99% rename from crates/oaknode/src/nodes/timeremap.rs rename to crates/oak-node/src/nodes/timeremap.rs index f4a10aabd..ed284b7e1 100644 --- a/crates/oaknode/src/nodes/timeremap.rs +++ b/crates/oak-node/src/nodes/timeremap.rs @@ -20,7 +20,7 @@ use crate::factory::NodeMeta; use crate::node::{Category, NodeBehavior, NodeCore}; use crate::value::{NodeValue, NodeValueRow, NodeValueTable}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; /// Target-time input id (C++ `k_time_input`). Type: rational; default /// `Rational(0)`; flags: not-connectable; properties: `view = time slider`, @@ -216,7 +216,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/transformdistortnode.rs b/crates/oak-node/src/nodes/transformdistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/transformdistortnode.rs rename to crates/oak-node/src/nodes/transformdistortnode.rs index 695aed308..91546b2bf 100644 --- a/crates/oaknode/src/nodes/transformdistortnode.rs +++ b/crates/oak-node/src/nodes/transformdistortnode.rs @@ -340,7 +340,7 @@ impl NodeBehavior for TransformDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let parent = match inputs.get(PARENT_INPUT) { @@ -597,7 +597,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/trigonometry.rs b/crates/oak-node/src/nodes/trigonometry.rs similarity index 99% rename from crates/oaknode/src/nodes/trigonometry.rs rename to crates/oak-node/src/nodes/trigonometry.rs index 7683d2f0f..6b6abbe89 100644 --- a/crates/oaknode/src/nodes/trigonometry.rs +++ b/crates/oak-node/src/nodes/trigonometry.rs @@ -121,7 +121,7 @@ impl NodeBehavior for TrigonometryNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let mut x = match inputs.get(X_INPUT) { @@ -218,7 +218,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/valuenode.rs b/crates/oak-node/src/nodes/valuenode.rs similarity index 99% rename from crates/oaknode/src/nodes/valuenode.rs rename to crates/oak-node/src/nodes/valuenode.rs index 54171e79f..2c228f199 100644 --- a/crates/oaknode/src/nodes/valuenode.rs +++ b/crates/oak-node/src/nodes/valuenode.rs @@ -117,7 +117,7 @@ impl NodeBehavior for ValueNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let _ = inputs; @@ -176,7 +176,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/nodes/volume.rs b/crates/oak-node/src/nodes/volume.rs similarity index 98% rename from crates/oaknode/src/nodes/volume.rs rename to crates/oak-node/src/nodes/volume.rs index b1f9eb32f..681429361 100644 --- a/crates/oaknode/src/nodes/volume.rs +++ b/crates/oak-node/src/nodes/volume.rs @@ -88,7 +88,7 @@ impl NodeBehavior for VolumeNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let buffer = match inputs.get(SAMPLES_INPUT) { @@ -125,7 +125,7 @@ impl NodeBehavior for VolumeNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - range: oakcore_rs::TimeRange, + range: oak_core::TimeRange, output: &mut crate::value::SampleBuffer, ) { let input = match inputs.get(SAMPLES_INPUT) { @@ -181,7 +181,7 @@ pub fn create() -> (NodeCore, Box) { mod tests { use super::*; use crate::value::NodeValueTable; - use oakcore_rs::{Rational, SampleFormat, TimeRange}; + use oak_core::{Rational, SampleFormat, TimeRange}; fn planar(channels: usize, count: usize, values: &[f64]) -> crate::value::SampleBuffer { let mut buf = crate::value::SampleBuffer { diff --git a/crates/oaknode/src/nodes/wavedistortnode.rs b/crates/oak-node/src/nodes/wavedistortnode.rs similarity index 99% rename from crates/oaknode/src/nodes/wavedistortnode.rs rename to crates/oak-node/src/nodes/wavedistortnode.rs index 8e63e745f..ebf06afb9 100644 --- a/crates/oaknode/src/nodes/wavedistortnode.rs +++ b/crates/oak-node/src/nodes/wavedistortnode.rs @@ -140,7 +140,7 @@ impl NodeBehavior for WaveDistortNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { let tex = match inputs.get(TEXTURE_INPUT) { @@ -226,7 +226,7 @@ mod tests { use super::*; use crate::node::NodeBehavior; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; fn tex() -> NodeValue { NodeValue::Texture(crate::handle::CHandle::null()) diff --git a/crates/oaknode/src/nodes/whitebalance.rs b/crates/oak-node/src/nodes/whitebalance.rs similarity index 99% rename from crates/oaknode/src/nodes/whitebalance.rs rename to crates/oak-node/src/nodes/whitebalance.rs index 3f311864f..a7c9e3e41 100644 --- a/crates/oaknode/src/nodes/whitebalance.rs +++ b/crates/oak-node/src/nodes/whitebalance.rs @@ -166,7 +166,7 @@ impl NodeBehavior for WhiteBalanceNode { &self, core: &NodeCore, inputs: &crate::value::NodeValueRow, - time: oakcore_rs::Rational, + time: oak_core::Rational, table: &mut crate::value::NodeValueTable, ) { match inputs.get(TEXTURE_INPUT) { @@ -267,7 +267,7 @@ pub fn register(meta: &mut Vec) { mod tests { use super::*; use crate::value::{NodeValue, NodeValueTable, ValueType}; - use oakcore_rs::Rational; + use oak_core::Rational; #[test] fn input_names() { diff --git a/crates/oaknode/src/ops.rs b/crates/oak-node/src/ops.rs similarity index 98% rename from crates/oaknode/src/ops.rs rename to crates/oak-node/src/ops.rs index fbf25215c..16b7d9ddc 100644 --- a/crates/oaknode/src/ops.rs +++ b/crates/oak-node/src/ops.rs @@ -17,8 +17,8 @@ //! Free functions replacing the C++ `Node` static methods //! (COVERAGE.md §6/§9). -use oakcore_rs::TimeRange; -use oakundo::undocommand::UndoCommand; +use oak_core::TimeRange; +use oak_undo::undocommand::UndoCommand; use crate::graph::Graph; use crate::id::NodeId; @@ -175,7 +175,7 @@ pub fn set_value_at_time_command( node: NodeId, input: &str, element: i32, - time: oakcore_rs::Rational, + time: oak_core::Rational, value: &crate::value::NodeValue, ) -> crate::error::Result { use crate::error::Error; diff --git a/crates/oaknode/src/project.rs b/crates/oak-node/src/project.rs similarity index 99% rename from crates/oaknode/src/project.rs rename to crates/oak-node/src/project.rs index 3413a0679..9312d818e 100644 --- a/crates/oaknode/src/project.rs +++ b/crates/oak-node/src/project.rs @@ -318,7 +318,7 @@ impl Project { } // Default location: the shared disk-cache directory (single-lib: // lives in oakcommon, used by oaknode and oakrender alike). - oakcommon::filefunctions::default_disk_cache_path() + oak_common::filefunctions::default_disk_cache_path() } /// Copy all settings from `src` into `self` (C++ diff --git a/crates/oaknode/src/sequence.rs b/crates/oak-node/src/sequence.rs similarity index 95% rename from crates/oaknode/src/sequence.rs rename to crates/oak-node/src/sequence.rs index 902d7bf4e..e3a358cc9 100644 --- a/crates/oaknode/src/sequence.rs +++ b/crates/oak-node/src/sequence.rs @@ -42,13 +42,13 @@ pub struct SequenceBehavior { /// facade through the C ABI). pub workarea: crate::handle::CHandle, /// Length cache (C++ last_length_). - pub last_length: oakcore_rs::Rational, + pub last_length: oak_core::Rational, /// Autocache toggles. pub autocache_video: bool, /// Audio autocache toggle. pub autocache_audio: bool, /// Playhead position (C++ ViewerOutput::playhead_). - pub playhead: oakcore_rs::Rational, + pub playhead: oak_core::Rational, /// Video parameter streams. pub video_params: Vec, /// Audio parameter streams. @@ -62,10 +62,10 @@ impl SequenceBehavior { track_lists: Vec::new(), markers: crate::handle::CHandle::null(), workarea: crate::handle::CHandle::null(), - last_length: oakcore_rs::Rational::new(0, 1), + last_length: oak_core::Rational::new(0, 1), autocache_video: false, autocache_audio: false, - playhead: oakcore_rs::Rational::new(0, 1), + playhead: oak_core::Rational::new(0, 1), video_params: Vec::new(), audio_params: Vec::new(), } @@ -125,7 +125,7 @@ impl SequenceBehavior { /// `ViewerOutput::set_default_parameters()`; the config lookups read /// the oakcommon config store directly). pub fn set_default_parameters(&mut self) { - let config = oakcommon::configstore::ConfigStore::instance(); + let config = oak_common::configstore::ConfigStore::instance(); let width = config.get_int(None, "DefaultSequenceWidth", 1920); let height = config.get_int(None, "DefaultSequenceHeight", 1080); let sample_rate = config.get_int(None, "DefaultSequenceAudioFrequency", 48000); @@ -135,7 +135,7 @@ impl SequenceBehavior { self.video_params = vec![VideoParams { width, height, - frame_rate: oakcore_rs::Rational::new(fps_num as i64, fps_den as i64), + frame_rate: oak_core::Rational::new(fps_num as i64, fps_den as i64), pixel_format: 4, // f32 channels: 4, }]; @@ -151,9 +151,9 @@ impl SequenceBehavior { pub fn verify_length( &mut self, lengths: ( - oakcore_rs::Rational, - oakcore_rs::Rational, - oakcore_rs::Rational, + oak_core::Rational, + oak_core::Rational, + oak_core::Rational, ), ) { let (video, audio, overall) = lengths; diff --git a/crates/oaknode/src/serializer.rs b/crates/oak-node/src/serializer.rs similarity index 99% rename from crates/oaknode/src/serializer.rs rename to crates/oak-node/src/serializer.rs index 41f40d3f7..9af5ee9d5 100644 --- a/crates/oaknode/src/serializer.rs +++ b/crates/oak-node/src/serializer.rs @@ -32,8 +32,8 @@ use std::sync::{Arc, Mutex}; -use oakcommon::xmlutils::{XmlReader, XmlWriter}; -use oakcore_rs::Rational; +use oak_common::xmlutils::{XmlReader, XmlWriter}; +use oak_core::Rational; use crate::graph::Graph; use crate::id::NodeId; diff --git a/crates/oaknode/src/track.rs b/crates/oak-node/src/track.rs similarity index 94% rename from crates/oaknode/src/track.rs rename to crates/oak-node/src/track.rs index 1611a1e81..514d7e8e9 100644 --- a/crates/oaknode/src/track.rs +++ b/crates/oak-node/src/track.rs @@ -201,7 +201,7 @@ impl TrackBehavior { /// `block_containing_time`). pub fn block_containing_time( &self, - time: oakcore_rs::Rational, + time: oak_core::Rational, blocks: &dyn BlockRange, ) -> Option { self.blocks @@ -214,7 +214,7 @@ impl TrackBehavior { /// `visible_block_at_time`). pub fn visible_block_at_time( &self, - time: oakcore_rs::Rational, + time: oak_core::Rational, blocks: &dyn BlockRange, ) -> Option { self.blocks @@ -225,13 +225,13 @@ impl TrackBehavior { /// Whether the [in, out) range holds no block or only a gap (C++ /// `is_range_free`). - pub fn is_range_free(&self, range: oakcore_rs::TimeRange, blocks: &dyn BlockRange) -> bool { + pub fn is_range_free(&self, range: oak_core::TimeRange, blocks: &dyn BlockRange) -> bool { !self.blocks.iter().any(|b| blocks.overlaps(*b, range)) } /// Total length (end of the last block; C++ `Track::get_length`). - pub fn length(&self, blocks: &dyn BlockRange) -> oakcore_rs::Rational { - let mut end = oakcore_rs::Rational::new(0, 1); + pub fn length(&self, blocks: &dyn BlockRange) -> oak_core::Rational { + let mut end = oak_core::Rational::new(0, 1); for b in &self.blocks { let out = blocks.out(*b); if out > end { @@ -251,21 +251,21 @@ impl TrackBehavior { /// (block in/out/length) without coupling track.rs to the graph arena. pub trait BlockRange { /// In-point of `block`. - fn in_(&self, block: NodeId) -> oakcore_rs::Rational; + fn in_(&self, block: NodeId) -> oak_core::Rational; /// Out-point of `block`. - fn out(&self, block: NodeId) -> oakcore_rs::Rational; + fn out(&self, block: NodeId) -> oak_core::Rational; /// True when `time` is strictly inside the block. - fn contains_strict(&self, block: NodeId, time: oakcore_rs::Rational) -> bool { + fn contains_strict(&self, block: NodeId, time: oak_core::Rational) -> bool { let (in_, out) = (self.in_(block), self.out(block)); time > in_ && time < out } /// True when `time` is visible on the block (in <= t < out). - fn contains(&self, block: NodeId, time: oakcore_rs::Rational) -> bool { + fn contains(&self, block: NodeId, time: oak_core::Rational) -> bool { let (in_, out) = (self.in_(block), self.out(block)); time >= in_ && time < out } /// True when the block's span overlaps `range`. - fn overlaps(&self, block: NodeId, range: oakcore_rs::TimeRange) -> bool { + fn overlaps(&self, block: NodeId, range: oak_core::TimeRange) -> bool { let (in_, out) = (self.in_(block), self.out(block)); !(out <= range.in_() || in_ >= range.out()) } @@ -301,8 +301,8 @@ impl TrackListBehavior { /// Combined length of the longest track (C++ /// `TrackList::get_total_length`). - pub fn total_length(&self, tracks: &dyn TrackRange) -> oakcore_rs::Rational { - let mut longest = oakcore_rs::Rational::new(0, 1); + pub fn total_length(&self, tracks: &dyn TrackRange) -> oak_core::Rational { + let mut longest = oak_core::Rational::new(0, 1); for t in &self.tracks { let len = tracks.length(*t); if len > longest { @@ -533,5 +533,5 @@ impl NodeBehavior for TrackListBehavior { /// Track-length accessor trait (the graph-backed query the list needs). pub trait TrackRange { /// Total length of `track`. - fn length(&self, track: NodeId) -> oakcore_rs::Rational; + fn length(&self, track: NodeId) -> oak_core::Rational; } diff --git a/crates/oaknode/src/traverser.rs b/crates/oak-node/src/traverser.rs similarity index 99% rename from crates/oaknode/src/traverser.rs rename to crates/oak-node/src/traverser.rs index 75ec4b73e..d07aeef69 100644 --- a/crates/oaknode/src/traverser.rs +++ b/crates/oak-node/src/traverser.rs @@ -26,7 +26,7 @@ use std::collections::{HashMap, HashSet}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; use crate::graph::Graph; use crate::id::NodeId; diff --git a/crates/oaknode/src/value.rs b/crates/oak-node/src/value.rs similarity index 99% rename from crates/oaknode/src/value.rs rename to crates/oak-node/src/value.rs index a1d6dee5e..3c4179c79 100644 --- a/crates/oaknode/src/value.rs +++ b/crates/oak-node/src/value.rs @@ -28,7 +28,7 @@ use std::ffi::c_int; -use oakcore_rs::{Rational, SampleFormat}; +use oak_core::{Rational, SampleFormat}; /// `oaknode_value_type` discriminants (include/node/node.h), used by the /// ffi layer to marshal [`NodeValue`]s across the C boundary. @@ -105,7 +105,7 @@ pub enum ValueType { PushButton, /// Parametric curve (OpenFX parametric param; the value payload is a /// [`NodeValue::Text`] JSON document, see - /// `oakplugin::param_curve::curves_to_json` — string-carried like + /// `oak_plugin::param_curve::curves_to_json` — string-carried like /// [`ValueType::Text`]). Parametric, } diff --git a/crates/oaknode/tests/engine_units_test.rs b/crates/oak-node/tests/engine_units_test.rs similarity index 95% rename from crates/oaknode/tests/engine_units_test.rs rename to crates/oak-node/tests/engine_units_test.rs index e36236065..82c9be7e7 100644 --- a/crates/oaknode/tests/engine_units_test.rs +++ b/crates/oak-node/tests/engine_units_test.rs @@ -19,15 +19,15 @@ //! drive every conversion/interpolation/query arm so the implemented //! modules hold the ≥80% coverage gate. -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; -use oaknode::error::{Error, OAKNODE_E_INVALID}; -use oaknode::handle::{self, CHandle, RefBox}; -use oaknode::id::NodeId; -use oaknode::input::{flags, Input, ValueHint}; -use oaknode::keyframe::{Interpolation, Keyframe}; -use oaknode::node::{Category, NodeBehavior, NodeCore}; -use oaknode::value::{ +use oak_node::error::{Error, OAKNODE_E_INVALID}; +use oak_node::handle::{self, CHandle, RefBox}; +use oak_node::id::NodeId; +use oak_node::input::{flags, Input, ValueHint}; +use oak_node::keyframe::{Interpolation, Keyframe}; +use oak_node::node::{Category, NodeBehavior, NodeCore}; +use oak_node::value::{ oak, AudioParams, NodeValue, NodeValueTable, OakNodeValue, SampleBuffer, ValueType, VideoParams, }; @@ -318,13 +318,13 @@ fn value_equality_and_buffer() { // Samples equality compares payload. let a = SampleBuffer { - format: oakcore_rs::SampleFormat::F32, + format: oak_core::SampleFormat::F32, channels: 2, sample_count: 4, data: vec![0u8; 32], }; let b = SampleBuffer { - format: oakcore_rs::SampleFormat::F32, + format: oak_core::SampleFormat::F32, channels: 2, sample_count: 4, data: vec![0u8; 32], @@ -656,7 +656,7 @@ fn node_core_helpers() { /// and returns its documented neutral value. #[test] fn node_behavior_defaults() { - use oaknode::node::NodeBehavior; + use oak_node::node::NodeBehavior; struct Minimal; impl NodeBehavior for Minimal { @@ -727,7 +727,7 @@ fn node_behavior_defaults() { /// A reader/writer pair for the serializer-default coverage (the real /// XML adapter lands with the serializer milestone). struct NoopReader; -impl oaknode::serializer::XmlRead for NoopReader { +impl oak_node::serializer::XmlRead for NoopReader { fn next_start_element(&mut self) -> bool { false } @@ -744,7 +744,7 @@ impl oaknode::serializer::XmlRead for NoopReader { } struct NoopWriter; -impl oaknode::serializer::XmlWrite for NoopWriter { +impl oak_node::serializer::XmlWrite for NoopWriter { fn start_element(&mut self, _name: &str) {} fn end_element(&mut self) {} fn attribute(&mut self, _name: &str, _value: &str) {} @@ -754,7 +754,7 @@ impl oaknode::serializer::XmlWrite for NoopWriter { /// node.rs: NodeCaches default + clone + enabled-in default value. #[test] fn node_caches_and_defaults() { - let caches = oaknode::node::NodeCaches::default(); + let caches = oak_node::node::NodeCaches::default(); assert!(caches.video.ctx.is_null()); assert!(caches.thumbnail.ctx.is_null()); assert!(caches.audio.ctx.is_null()); @@ -771,25 +771,25 @@ fn node_caches_and_defaults() { /// folder.rs: FolderBehavior surface. #[test] fn folder_behavior_surface() { - let mut folder = oaknode::folder::FolderBehavior::new("My Folder"); + let mut folder = oak_node::folder::FolderBehavior::new("My Folder"); assert_eq!(folder.name, "My Folder"); assert!(folder.children.is_empty()); folder.children.push(NodeId::from_identity(1).unwrap()); - let b: Box = Box::new(oaknode::folder::FolderBehavior::new("X")); + let b: Box = Box::new(oak_node::folder::FolderBehavior::new("X")); assert_eq!(b.name(), "X"); assert_eq!(b.type_id(), "org.olivevideoeditor.Olive.folder"); assert_eq!(b.categories(), &[Category::Timeline]); assert!(b.duplicate(&NodeCore::new()).is_some()); // create() builds a folder node (bare core, no enabled_in). - let (core, behavior) = oaknode::folder::create("Root"); + let (core, behavior) = oak_node::folder::create("Root"); assert!(!core.has_input("enabled_in")); assert_eq!(behavior.name(), "Root"); // register() adds a folder entry to the registry table. let mut meta = Vec::new(); - oaknode::folder::register(&mut meta); + oak_node::folder::register(&mut meta); assert_eq!(meta.len(), 1); assert_eq!(meta[0].type_id, "org.olivevideoeditor.Olive.folder"); let (_, b2) = (meta[0].create)(); @@ -799,8 +799,8 @@ fn folder_behavior_surface() { /// ops.rs: category names and copy_inputs. #[test] fn ops_category_and_copy_inputs() { - use oaknode::graph::Graph; - use oaknode::ops; + use oak_node::graph::Graph; + use oak_node::ops; assert_eq!(ops::category_name(Category::Output), "Output"); assert_eq!(ops::category_name(Category::Effect), "Effect"); @@ -820,7 +820,7 @@ fn ops_category_and_copy_inputs() { let mk = |g: &mut Graph, id: &str| { let mut core = NodeCore::new(); core.add_input(Input::new(id, ValueType::Float, float(0.0))); - g.add_node(core, Box::new(oaknode::nodes::EmptyBehavior)) + g.add_node(core, Box::new(oak_node::nodes::EmptyBehavior)) }; let src = mk(&mut g, "val_in"); let dst = mk(&mut g, "val_in"); @@ -893,14 +893,14 @@ fn handle_boxing_discipline() { #[test] fn error_codes_map() { assert_eq!(Error::Invalid.code(), OAKNODE_E_INVALID); - assert_eq!(Error::State.code(), oaknode::error::OAKNODE_E_STATE); + assert_eq!(Error::State.code(), oak_node::error::OAKNODE_E_STATE); assert_eq!( Error::Failed("x".to_string()).code(), - oaknode::error::OAKNODE_E_FAILED + oak_node::error::OAKNODE_E_FAILED ); - assert_eq!(Error::NotFound.code(), oaknode::error::OAKNODE_E_NOT_FOUND); - assert_eq!(Error::NoMem.code(), oaknode::error::OAKNODE_E_NOMEM); - assert_eq!(oaknode::error::OAKNODE_OK, 0); + assert_eq!(Error::NotFound.code(), oak_node::error::OAKNODE_E_NOT_FOUND); + assert_eq!(Error::NoMem.code(), oak_node::error::OAKNODE_E_NOMEM); + assert_eq!(oak_node::error::OAKNODE_OK, 0); } /// id.rs: identity packing and INVALID sentinel. diff --git a/crates/oaknode/tests/factory_smoke_test.rs b/crates/oak-node/tests/factory_smoke_test.rs similarity index 98% rename from crates/oaknode/tests/factory_smoke_test.rs rename to crates/oak-node/tests/factory_smoke_test.rs index 387b1d57d..b2715faa1 100644 --- a/crates/oaknode/tests/factory_smoke_test.rs +++ b/crates/oak-node/tests/factory_smoke_test.rs @@ -21,8 +21,8 @@ //! enum indices but the switch reorders log/white-balance after //! linear, and tile/swirl/ripple after wave). -use oaknode::factory::Factory; -use oaknode::node::Category; +use oak_node::factory::Factory; +use oak_node::node::Category; /// Expected `type_id` sequence, in C++ registration order /// (`factory.cpp::create_from_factory_index`; the plugin nodes that diff --git a/crates/oaknode/tests/graph_test.rs b/crates/oak-node/tests/graph_test.rs similarity index 97% rename from crates/oaknode/tests/graph_test.rs rename to crates/oak-node/tests/graph_test.rs index 0834b34a1..290cbb1f6 100644 --- a/crates/oaknode/tests/graph_test.rs +++ b/crates/oak-node/tests/graph_test.rs @@ -16,12 +16,12 @@ //! Graph arena contract tests (graph.rs / id.rs). -use oaknode::error::Error; -use oaknode::graph::Graph; -use oaknode::id::NodeId; -use oaknode::input::{flags, Input}; -use oaknode::node::{Category, NodeBehavior, NodeCore}; -use oaknode::value::{NodeValue, ValueType}; +use oak_node::error::Error; +use oak_node::graph::Graph; +use oak_node::id::NodeId; +use oak_node::input::{flags, Input}; +use oak_node::node::{Category, NodeBehavior, NodeCore}; +use oak_node::value::{NodeValue, ValueType}; /// A minimal test node: `enabled_in` + one connectable float input. struct TestNode { diff --git a/crates/oaknode/tests/phase2_units_test.rs b/crates/oak-node/tests/phase2_units_test.rs similarity index 89% rename from crates/oaknode/tests/phase2_units_test.rs rename to crates/oak-node/tests/phase2_units_test.rs index a81c9c67c..0642f620a 100644 --- a/crates/oaknode/tests/phase2_units_test.rs +++ b/crates/oak-node/tests/phase2_units_test.rs @@ -18,17 +18,17 @@ //! serializer/bridge::undo engine internals, closing the coverage gaps //! the ffi contract tests leave open. -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; -use oaknode::block::{BlockCore, ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; -use oaknode::colormanager::ColorManager; -use oaknode::footage::FootageBehavior; -use oaknode::id::NodeId; -use oaknode::serializer::{string_to_value, value_to_string}; -use oaknode::track::{ +use oak_node::block::{BlockCore, ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; +use oak_node::colormanager::ColorManager; +use oak_node::footage::FootageBehavior; +use oak_node::id::NodeId; +use oak_node::serializer::{string_to_value, value_to_string}; +use oak_node::track::{ pixel_height_to_internal_height, TrackBehavior, TrackListBehavior, TrackType, }; -use oaknode::value::{NodeValue, ValueType}; +use oak_node::value::{NodeValue, ValueType}; /// block.rs: BlockCore range/media arithmetic. #[test] @@ -62,7 +62,7 @@ fn block_core_ranges() { #[test] fn block_behaviors_and_inputs() { // Clip: new + the static inputs. - let (core, behavior) = oaknode::block::clip_create(); + let (core, behavior) = oak_node::block::clip_create(); assert!(core.has_input("enabled_in")); assert!(core.has_input("media_in_in")); assert!(core.has_input("speed_in")); @@ -79,14 +79,14 @@ fn block_behaviors_and_inputs() { assert!(clip.footage.is_none()); // Gap. - let (core, behavior) = oaknode::block::gap_create(); + let (core, behavior) = oak_node::block::gap_create(); assert_eq!(behavior.name(), "Gap"); assert_eq!(behavior.type_id(), "org.olivevideoeditor.Olive.gapblock"); let gap = GapBlockBehavior::new(); assert_eq!(gap.core.speed, 1.0); // Transition. - let (core, behavior) = oaknode::block::transition_create(); + let (core, behavior) = oak_node::block::transition_create(); assert!(core.has_input("out_block_in")); assert!(core.has_input("in_block_in")); assert_eq!( @@ -105,7 +105,7 @@ fn block_behaviors_and_inputs() { #[test] fn track_behavior_ops() { struct Ranges; - impl oaknode::track::BlockRange for Ranges { + impl oak_node::track::BlockRange for Ranges { fn in_(&self, b: NodeId) -> Rational { match b.index() { 0 => Rational::new(0, 1), @@ -186,7 +186,7 @@ fn track_behavior_ops() { #[test] fn tracklist_and_height() { struct Ranges; - impl oaknode::track::TrackRange for Ranges { + impl oak_node::track::TrackRange for Ranges { fn length(&self, t: NodeId) -> Rational { Rational::new(t.index() as i64 + 1, 1) } @@ -205,12 +205,12 @@ fn tracklist_and_height() { // Height conversions (C++ Track::internal_height_to_pixel_height). assert_eq!( - oaknode::track::internal_height_to_pixel_height(3.0), + oak_node::track::internal_height_to_pixel_height(3.0), 39, "default height in px" ); assert_eq!( - oaknode::track::internal_height_to_pixel_height(1.5), + oak_node::track::internal_height_to_pixel_height(1.5), 20, "minimum height in px" ); @@ -222,25 +222,25 @@ fn tracklist_and_height() { fn footage_queries() { let mut f = FootageBehavior::new("x.mov"); f.streams = vec![ - oaknode::footage::StreamInfo { + oak_node::footage::StreamInfo { index: 0, is_video: true, - video: Some(oaknode::value::VideoParams::default()), + video: Some(oak_node::value::VideoParams::default()), audio: None, duration: Rational::new(10, 1), }, - oaknode::footage::StreamInfo { + oak_node::footage::StreamInfo { index: 1, is_video: true, - video: Some(oaknode::value::VideoParams::default()), + video: Some(oak_node::value::VideoParams::default()), audio: None, duration: Rational::new(20, 1), }, - oaknode::footage::StreamInfo { + oak_node::footage::StreamInfo { index: 2, is_video: false, video: None, - audio: Some(oaknode::value::AudioParams::default()), + audio: Some(oak_node::value::AudioParams::default()), duration: Rational::new(30, 1), }, ]; @@ -344,16 +344,16 @@ fn serializer_value_codecs() { // Interpolation mapping. assert_eq!( - oaknode::serializer::interpolation_from_c(0), - oaknode::keyframe::Interpolation::Linear + oak_node::serializer::interpolation_from_c(0), + oak_node::keyframe::Interpolation::Linear ); assert_eq!( - oaknode::serializer::interpolation_from_c(1), - oaknode::keyframe::Interpolation::Hold + oak_node::serializer::interpolation_from_c(1), + oak_node::keyframe::Interpolation::Hold ); assert_eq!( - oaknode::serializer::interpolation_from_c(2), - oaknode::keyframe::Interpolation::Bezier + oak_node::serializer::interpolation_from_c(2), + oak_node::keyframe::Interpolation::Bezier ); } @@ -363,7 +363,7 @@ fn serializer_value_codecs() { fn undo_command_roundtrip() { use std::sync::atomic::{AtomicI32, Ordering}; use std::sync::Arc; - use oakundo::undocommand::UndoCommand; + use oak_undo::undocommand::UndoCommand; fn from_closures( redo: impl FnMut() + Send + 'static, @@ -431,10 +431,10 @@ fn undo_command_roundtrip() { /// paths, empty range queries, duplicates, and naming. #[test] fn track_edge_cases() { - use oaknode::node::NodeBehavior; + use oak_node::node::NodeBehavior; struct Ranges; - impl oaknode::track::BlockRange for Ranges { + impl oak_node::track::BlockRange for Ranges { fn in_(&self, b: NodeId) -> Rational { Rational::new(b.index() as i64, 1) } @@ -443,7 +443,7 @@ fn track_edge_cases() { } } struct Tr; - impl oaknode::track::TrackRange for Tr { + impl oak_node::track::TrackRange for Tr { fn length(&self, t: NodeId) -> Rational { Rational::new(t.index() as i64, 1) } @@ -491,7 +491,7 @@ fn track_edge_cases() { assert_eq!(empty.reference(), (0, 0), "video type, default index"); // duplicate preserves the block list and kind. - let dup = track.duplicate(&oaknode::node::NodeCore::new()).unwrap(); + let dup = track.duplicate(&oak_node::node::NodeCore::new()).unwrap(); let d = dup .as_any() .unwrap() @@ -508,7 +508,7 @@ fn track_edge_cases() { assert_eq!(list.track_index(b0), None); assert_eq!(list.total_length(&Tr), Rational::new(0, 1)); list.tracks.push(b0); - let dup = list.duplicate(&oaknode::node::NodeCore::new()).unwrap(); + let dup = list.duplicate(&oak_node::node::NodeCore::new()).unwrap(); let d = dup .as_any() .unwrap() @@ -522,7 +522,7 @@ fn track_edge_cases() { /// footage.rs: probe failure path, proxy field round-trip, duplicate. #[test] fn footage_edge_cases() { - use oaknode::node::NodeBehavior; + use oak_node::node::NodeBehavior; let mut f = FootageBehavior::new("nonexistent.mov"); // probe errors when oakcodec is unavailable (test build). @@ -546,7 +546,7 @@ fn footage_edge_cases() { // duplicate preserves the fields. f.set_proxy("/p2.mov", 1, 0, 0, true); - let dup = f.duplicate(&oaknode::node::NodeCore::new()).unwrap(); + let dup = f.duplicate(&oak_node::node::NodeCore::new()).unwrap(); let d = dup .as_any() .unwrap() @@ -562,8 +562,8 @@ fn footage_edge_cases() { /// sequence.rs: stream counts, verify_length, defaults, duplicate. #[test] fn sequence_edge_cases() { - use oaknode::node::NodeBehavior; - use oaknode::sequence::SequenceBehavior; + use oak_node::node::NodeBehavior; + use oak_node::sequence::SequenceBehavior; let mut seq = SequenceBehavior::new(); assert_eq!(seq.name(), "Sequence"); @@ -580,7 +580,7 @@ fn sequence_edge_cases() { assert_eq!(seq.video_stream_count(), 1, "default video params"); assert_eq!(seq.audio_stream_count(), 1, "default audio params"); - let dup = seq.duplicate(&oaknode::node::NodeCore::new()).unwrap(); + let dup = seq.duplicate(&oak_node::node::NodeCore::new()).unwrap(); let d = dup .as_any() .unwrap() @@ -597,19 +597,19 @@ fn sequence_edge_cases() { /// passthrough, and duplication. #[test] fn group_behavior_edges() { - use oaknode::node::NodeBehavior; - use oaknode::nodes::group::{InnerInput, NodeGroup}; - use oaknode::project::Project; + use oak_node::node::NodeBehavior; + use oak_node::nodes::group::{InnerInput, NodeGroup}; + use oak_node::project::Project; let project = Project::new(); let (inner_id, group_id) = { let mut p = project.lock().unwrap(); - let (core, behavior) = (oaknode::factory::Factory::global() + let (core, behavior) = (oak_node::factory::Factory::global() .find("org.olivevideoeditor.Olive.math") .unwrap() .create)(); let inner = p.graph.add_node(core, behavior); - let (gcore, gbehavior) = oaknode::nodes::group::create(); + let (gcore, gbehavior) = oak_node::nodes::group::create(); let group = p.graph.add_node(gcore, gbehavior); (inner, group) }; @@ -654,7 +654,7 @@ fn group_behavior_edges() { // inner nodes: the second mints `param_a_in_2` (id-collision loop). let (g1, g2) = { let mut p = project.lock().unwrap(); - let (core2, behavior2) = (oaknode::factory::Factory::global() + let (core2, behavior2) = (oak_node::factory::Factory::global() .find("org.olivevideoeditor.Olive.math") .unwrap() .create)(); @@ -822,10 +822,10 @@ fn group_behavior_edges() { #[cfg(feature = "test-stubs")] #[test] fn group_serialization() { - use oaknode::node::NodeBehavior; - use oaknode::nodes::group::NodeGroup; + use oak_node::node::NodeBehavior; + use oak_node::nodes::group::NodeGroup; - let mut gb = oaknode::nodes::group::create().1; + let mut gb = oak_node::nodes::group::create().1; let gb = gb .as_any_mut() .unwrap() @@ -833,27 +833,27 @@ fn group_serialization() { .unwrap(); // save_custom writes the passthrough elements. - let mut writer = oaknode::serializer::XmlWriterBridge::new().unwrap(); + let mut writer = oak_node::serializer::XmlWriterBridge::new().unwrap(); { - use oaknode::node::NodeBehavior; - let core = oaknode::node::NodeCore::new(); + use oak_node::node::NodeBehavior; + let core = oak_node::node::NodeCore::new(); gb.save_custom(&core, &mut writer); } let xml = writer.output(); assert!(xml.contains("inputpassthroughs"), "writes the container"); // load_custom parses them back (node references deferred). - let mut gb = oaknode::nodes::group::create().1; + let mut gb = oak_node::nodes::group::create().1; let gb = gb .as_any_mut() .unwrap() .downcast_mut::() .unwrap(); - let mut reader = oaknode::serializer::XmlReaderBridge::new(&xml).unwrap(); + let mut reader = oak_node::serializer::XmlReaderBridge::new(&xml).unwrap(); { - use oaknode::node::NodeBehavior; - let mut core = oaknode::node::NodeCore::new(); + use oak_node::node::NodeBehavior; + let mut core = oak_node::node::NodeCore::new(); assert!(gb.load_custom(&mut core, &mut reader)); } - gb.post_load(&mut oaknode::node::NodeCore::new()); + gb.post_load(&mut oak_node::node::NodeCore::new()); } diff --git a/crates/oaknode/tests/serializer_test.rs b/crates/oak-node/tests/serializer_test.rs similarity index 89% rename from crates/oaknode/tests/serializer_test.rs rename to crates/oak-node/tests/serializer_test.rs index 5516b86a5..cbd8d8d4b 100644 --- a/crates/oaknode/tests/serializer_test.rs +++ b/crates/oak-node/tests/serializer_test.rs @@ -42,17 +42,17 @@ fn save_matches_cpp_byte_exact() { #[cfg(feature = "test-stubs")] #[test] fn roundtrip_idempotent() { - use oaknode::input::Input; - use oaknode::node::NodeCore; - use oaknode::project::Project; - use oaknode::value::{NodeValue, ValueType}; + use oak_node::input::Input; + use oak_node::node::NodeCore; + use oak_node::project::Project; + use oak_node::value::{NodeValue, ValueType}; let project = Project::new(); { let mut p = project.lock().unwrap(); p.initialize().unwrap(); // A math node with a set value + a keyframe. - let (core, behavior) = (oaknode::factory::Factory::global() + let (core, behavior) = (oak_node::factory::Factory::global() .find("org.olivevideoeditor.Olive.math") .unwrap() .create)(); @@ -67,15 +67,15 @@ fn roundtrip_idempotent() { .unwrap() .core .keyframe_track_mut("param_a_in", -1) - .set_key(oaknode::keyframe::Keyframe { - time: oakcore_rs::Rational::new(0, 1), + .set_key(oak_node::keyframe::Keyframe { + time: oak_core::Rational::new(0, 1), value: NodeValue::Float(1.0), - interpolation: oaknode::keyframe::Interpolation::Linear, + interpolation: oak_node::keyframe::Interpolation::Linear, bezier_in: (0.0, 0.0), bezier_out: (0.0, 0.0), }); // A second node connected to the first. - let (core2, behavior2) = (oaknode::factory::Factory::global() + let (core2, behavior2) = (oak_node::factory::Factory::global() .find("org.olivevideoeditor.Olive.math") .unwrap() .create)(); @@ -85,12 +85,12 @@ fn roundtrip_idempotent() { let xml = { let p = project.lock().unwrap(); - oaknode::serializer::save(&p).unwrap() + oak_node::serializer::save(&p).unwrap() }; - let loaded = oaknode::serializer::load(&xml).unwrap(); + let loaded = oak_node::serializer::load(&xml).unwrap(); let xml2 = { let p = loaded.lock().unwrap(); - oaknode::serializer::save(&p).unwrap() + oak_node::serializer::save(&p).unwrap() }; assert_eq!(xml, xml2, "re-save is idempotent"); @@ -118,12 +118,12 @@ fn historical_versions_upgrade() { // A current-format document round-trips. let xml = "{test}"; - let project = oaknode::serializer::load(xml).unwrap(); + let project = oak_node::serializer::load(xml).unwrap(); assert_eq!(project.lock().unwrap().uuid, "{test}"); // An unknown root is rejected. - assert!(oaknode::serializer::load("").is_err()); - assert!(oaknode::serializer::load("").is_err()); + assert!(oak_node::serializer::load("").is_err()); + assert!(oak_node::serializer::load("").is_err()); } /// Corrupt XML and newer-than-build versions are rejected with the @@ -132,14 +132,14 @@ fn historical_versions_upgrade() { fn corrupt_and_future_files_rejected() { // A newer-than-build version is rejected. let future = ""; - assert!(oaknode::serializer::load(future).is_err()); + assert!(oak_node::serializer::load(future).is_err()); // Malformed XML (unbalanced) is rejected without a panic. let corrupt = ""; - assert!(oaknode::serializer::load(corrupt).is_err()); + assert!(oak_node::serializer::load(corrupt).is_err()); // Garbage text. - assert!(oaknode::serializer::load("not xml at all").is_err()); + assert!(oak_node::serializer::load("not xml at all").is_err()); } /// The C++-era fixture project (`tests/project_with_footage.ove`, a @@ -149,16 +149,16 @@ fn corrupt_and_future_files_rejected() { /// survive, and the sequence's viewer connections resolve. #[test] fn golden_project_with_footage_loads() { - use oaknode::folder::FolderBehavior; - use oaknode::footage::FootageBehavior; - use oaknode::sequence::SequenceBehavior; + use oak_node::folder::FolderBehavior; + use oak_node::footage::FootageBehavior; + use oak_node::sequence::SequenceBehavior; let xml = std::fs::read_to_string(concat!( env!("CARGO_MANIFEST_DIR"), "/../../tests/project_with_footage.ove" )) .unwrap(); - let project = oaknode::serializer::load(&xml).unwrap(); + let project = oak_node::serializer::load(&xml).unwrap(); let p = project.lock().unwrap(); // The root folder (from the settings "root" key) holds the bin. @@ -227,17 +227,17 @@ fn golden_project_with_footage_loads() { /// folder holding a footage (streams/proxy/timestamp) and a sequence /// with video/audio track lists, tracks with clips and a gap, an effect /// chain with keyframes, plus settings and a link. -fn build_full_project() -> std::sync::Arc> { - use oakcore_rs::{Rational, TimeRange}; - use oaknode::block::{clip_create, gap_create, ClipBlockBehavior, GapBlockBehavior}; - use oaknode::folder::FolderBehavior; - use oaknode::footage::{FootageBehavior, StreamInfo}; - use oaknode::keyframe::{Interpolation, Keyframe}; - use oaknode::node::NodeCore; - use oaknode::project::Project; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; - use oaknode::value::{AudioParams, NodeValue, VideoParams}; +fn build_full_project() -> std::sync::Arc> { + use oak_core::{Rational, TimeRange}; + use oak_node::block::{clip_create, gap_create, ClipBlockBehavior, GapBlockBehavior}; + use oak_node::folder::FolderBehavior; + use oak_node::footage::{FootageBehavior, StreamInfo}; + use oak_node::keyframe::{Interpolation, Keyframe}; + use oak_node::node::NodeCore; + use oak_node::project::Project; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; + use oak_node::value::{AudioParams, NodeValue, VideoParams}; let project = Project::new(); let mut p = project.lock().unwrap(); @@ -365,7 +365,7 @@ fn build_full_project() -> std::sync::Arc std::sync::Arc( - p: &'a oaknode::project::Project, - id: oaknode::id::NodeId, -) -> &'a oaknode::track::TrackListBehavior { + p: &'a oak_node::project::Project, + id: oak_node::id::NodeId, +) -> &'a oak_node::track::TrackListBehavior { p.graph .get(id) .unwrap() .behavior .as_any() - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .unwrap() } /// Field-by-field comparison of the round-tripped full project. -fn assert_full_roundtrip_fields(orig: &oaknode::project::Project, loaded: &oaknode::project::Project) { - use oaknode::block::ClipBlockBehavior; - use oaknode::folder::FolderBehavior; - use oaknode::footage::FootageBehavior; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; +fn assert_full_roundtrip_fields(orig: &oak_node::project::Project, loaded: &oak_node::project::Project) { + use oak_node::block::ClipBlockBehavior; + use oak_node::folder::FolderBehavior; + use oak_node::footage::FootageBehavior; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; // Project shell: uuid + settings. assert_eq!(loaded.uuid, orig.uuid, "uuid"); @@ -716,7 +716,7 @@ fn assert_full_roundtrip_fields(orig: &oaknode::project::Project, loaded: &oakno .unwrap() .behavior .as_any() - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .unwrap(); let l_g1 = loaded .graph @@ -724,7 +724,7 @@ fn assert_full_roundtrip_fields(orig: &oaknode::project::Project, loaded: &oakno .unwrap() .behavior .as_any() - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .unwrap(); assert_eq!(l_g1.core.range, o_g1.core.range, "gap range"); assert_eq!(l_g1.core.track, Some(l_vtrack), "gap track backref"); @@ -853,9 +853,9 @@ fn roundtrip_full_timeline() { let project = build_full_project(); let xml = { let p = project.lock().unwrap(); - oaknode::serializer::save(&p).unwrap() + oak_node::serializer::save(&p).unwrap() }; - let loaded = oaknode::serializer::load(&xml).unwrap(); + let loaded = oak_node::serializer::load(&xml).unwrap(); { let o = project.lock().unwrap(); let l = loaded.lock().unwrap(); @@ -865,7 +865,7 @@ fn roundtrip_full_timeline() { // Re-save is idempotent (byte-identical). let xml2 = { let l = loaded.lock().unwrap(); - oaknode::serializer::save(&l).unwrap() + oak_node::serializer::save(&l).unwrap() }; assert_eq!(xml, xml2, "re-save is idempotent"); } @@ -875,9 +875,9 @@ fn roundtrip_full_timeline() { /// `ProjectSerializer::FileRoundTripPreservesMultiCamNode`). #[test] fn multicam_node_round_trip_preserves_current_in() { - use oaknode::nodes::multicamnode::{create, CURRENT_INPUT}; - use oaknode::project::Project; - use oaknode::value::NodeValue; + use oak_node::nodes::multicamnode::{create, CURRENT_INPUT}; + use oak_node::project::Project; + use oak_node::value::NodeValue; let project = Project::new(); let mc_id = { @@ -895,9 +895,9 @@ fn multicam_node_round_trip_preserves_current_in() { let xml = { let p = project.lock().unwrap(); - oaknode::serializer::save(&p).unwrap() + oak_node::serializer::save(&p).unwrap() }; - let loaded = oaknode::serializer::load(&xml).unwrap(); + let loaded = oak_node::serializer::load(&xml).unwrap(); let l = loaded.lock().unwrap(); let loaded_mc = l @@ -923,16 +923,16 @@ fn multicam_node_round_trip_preserves_current_in() { /// `sequence_in` edge, and the `sequence_type_in` selector all survive. #[test] fn multicam_clip_round_trip_preserves_wiring() { - use oakcore_rs::Rational; - use oaknode::block::{clip_create, ClipBlockBehavior}; - use oaknode::node::NodeCore; - use oaknode::nodes::multicamnode::{ + use oak_core::Rational; + use oak_node::block::{clip_create, ClipBlockBehavior}; + use oak_node::node::NodeCore; + use oak_node::nodes::multicamnode::{ create, CURRENT_INPUT, SEQUENCE_INPUT, SEQUENCE_TYPE_INPUT, }; - use oaknode::project::Project; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; - use oaknode::value::NodeValue; + use oak_node::project::Project; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; + use oak_node::value::NodeValue; let project = Project::new(); let (seq_id, clip_id, mc_id) = { @@ -982,7 +982,7 @@ fn multicam_clip_round_trip_preserves_wiring() { .unwrap() .downcast_mut::() .unwrap(); - c.core.range = oakcore_rs::TimeRange::new(Rational::new(0, 1), Rational::new(100, 1)); + c.core.range = oak_core::TimeRange::new(Rational::new(0, 1), Rational::new(100, 1)); c.core.track = Some(track_id); let track = p.graph.get_mut(track_id).unwrap(); let t = track @@ -1014,9 +1014,9 @@ fn multicam_clip_round_trip_preserves_wiring() { let xml = { let p = project.lock().unwrap(); - oaknode::serializer::save(&p).unwrap() + oak_node::serializer::save(&p).unwrap() }; - let loaded = oaknode::serializer::load(&xml).unwrap(); + let loaded = oak_node::serializer::load(&xml).unwrap(); let l = loaded.lock().unwrap(); // The multicam node round-tripped with its current_in and type selector. let loaded_mc = l @@ -1067,7 +1067,7 @@ fn multicam_clip_round_trip_preserves_wiring() { let mc_node = behavior .behavior .as_any() - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .expect("loaded node is a MultiCamNode"); assert_eq!(mc_node.sequence(), Some(seq_src)); } diff --git a/crates/oaknode/tests/structure_test.rs b/crates/oak-node/tests/structure_test.rs similarity index 93% rename from crates/oaknode/tests/structure_test.rs rename to crates/oak-node/tests/structure_test.rs index 475a1a87c..d659e34f8 100644 --- a/crates/oaknode/tests/structure_test.rs +++ b/crates/oak-node/tests/structure_test.rs @@ -20,13 +20,13 @@ //! The sequence / track / clip-cache / footage tests need the Phase 2 //! timeline and footage modules and stay ignored until then. -use oaknode::error::Error; -use oaknode::graph::Graph; -use oaknode::id::NodeId; -use oaknode::input::Input; -use oaknode::node::{NodeBehavior, NodeCore}; -use oaknode::project::{ChangeRecord, Project}; -use oaknode::value::{NodeValue, ValueType}; +use oak_node::error::Error; +use oak_node::graph::Graph; +use oak_node::id::NodeId; +use oak_node::input::Input; +use oak_node::node::{NodeBehavior, NodeCore}; +use oak_node::project::{ChangeRecord, Project}; +use oak_node::value::{NodeValue, ValueType}; /// Minimal test behavior. struct TestNode; @@ -250,7 +250,7 @@ fn project_sync_copy_consistency() { /// and one audio stream (set_default_parameters parity). #[test] fn sequence_default_structure() { - use oaknode::sequence::SequenceBehavior; + use oak_node::sequence::SequenceBehavior; let mut seq = SequenceBehavior::new(); assert!(seq.track_lists.is_empty()); @@ -263,9 +263,9 @@ fn sequence_default_structure() { ); assert_eq!(seq.video_params[0].height, 1080); assert_eq!(seq.audio_params[0].sample_rate, 48000); - assert_eq!(seq.playhead, oakcore_rs::Rational::new(0, 1)); - seq.playhead = oakcore_rs::Rational::new(30, 1); - assert_eq!(seq.playhead, oakcore_rs::Rational::new(30, 1)); + assert_eq!(seq.playhead, oak_core::Rational::new(0, 1)); + seq.playhead = oak_core::Rational::new(30, 1); + assert_eq!(seq.playhead, oak_core::Rational::new(30, 1)); } /// Track block ordering: append/prepend/insert keep timeline order; @@ -273,8 +273,8 @@ fn sequence_default_structure() { /// stay consistent (C++ Track semantics). #[test] fn track_block_ordering() { - use oakcore_rs::{Rational, TimeRange}; - use oaknode::track::{BlockRange, TrackBehavior, TrackType}; + use oak_core::{Rational, TimeRange}; + use oak_node::track::{BlockRange, TrackBehavior, TrackType}; struct Ranges; impl BlockRange for Ranges { @@ -326,9 +326,9 @@ fn track_block_ordering() { /// gracefully without partial state); proxy fields, counts, duration. #[test] fn footage_probe() { - use oakcore_rs::Rational; - use oaknode::footage::{FootageBehavior, StreamInfo}; - use oaknode::value::VideoParams; + use oak_core::Rational; + use oak_node::footage::{FootageBehavior, StreamInfo}; + use oak_node::value::VideoParams; let mut f = FootageBehavior::new("/nonexistent/file.mov"); assert!(!f.valid); @@ -356,7 +356,7 @@ fn footage_probe() { index: 1, is_video: false, video: None, - audio: Some(oaknode::value::AudioParams { + audio: Some(oak_node::value::AudioParams { sample_rate: 48000, channel_layout: 3, format: 4, diff --git a/crates/oaknode/tests/traverser_test.rs b/crates/oak-node/tests/traverser_test.rs similarity index 95% rename from crates/oaknode/tests/traverser_test.rs rename to crates/oak-node/tests/traverser_test.rs index 591d9c5d7..4a7143875 100644 --- a/crates/oaknode/tests/traverser_test.rs +++ b/crates/oak-node/tests/traverser_test.rs @@ -16,15 +16,15 @@ //! Traverser (evaluation engine) contract tests. -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; -use oaknode::error::Error; -use oaknode::graph::Graph; -use oaknode::id::NodeId; -use oaknode::input::Input; -use oaknode::node::{NodeBehavior, NodeCore}; -use oaknode::traverser::{EvalRequest, RenderHooks, Traverser}; -use oaknode::value::{NodeValue, NodeValueRow, NodeValueTable, ValueType}; +use oak_node::error::Error; +use oak_node::graph::Graph; +use oak_node::id::NodeId; +use oak_node::input::Input; +use oak_node::node::{NodeBehavior, NodeCore}; +use oak_node::traverser::{EvalRequest, RenderHooks, Traverser}; +use oak_node::value::{NodeValue, NodeValueRow, NodeValueTable, ValueType}; /// A source node: pushes its `val_in` standard value into the table. struct Src; diff --git a/crates/oaknode/tests/value_keyframe_test.rs b/crates/oak-node/tests/value_keyframe_test.rs similarity index 97% rename from crates/oaknode/tests/value_keyframe_test.rs rename to crates/oak-node/tests/value_keyframe_test.rs index 1beaa5a1b..914f514d1 100644 --- a/crates/oaknode/tests/value_keyframe_test.rs +++ b/crates/oak-node/tests/value_keyframe_test.rs @@ -18,10 +18,10 @@ use std::sync::atomic::Ordering; -use oakcore_rs::Rational; -use oaknode::handle::{self, CHandle, RefBox}; -use oaknode::keyframe::{Interpolation, Keyframe, KeyframeTrack}; -use oaknode::value::{NodeValue, NodeValueTable, ValueType}; +use oak_core::Rational; +use oak_node::handle::{self, CHandle, RefBox}; +use oak_node::keyframe::{Interpolation, Keyframe, KeyframeTrack}; +use oak_node::value::{NodeValue, NodeValueTable, ValueType}; /// NodeValueTable: last-push-wins per type, tag preserved, `get` of an /// absent type returns None (C++ NodeValueTable semantics). diff --git a/crates/oakotio/Cargo.lock b/crates/oak-otio/Cargo.lock similarity index 100% rename from crates/oakotio/Cargo.lock rename to crates/oak-otio/Cargo.lock diff --git a/crates/oakotio/Cargo.toml b/crates/oak-otio/Cargo.toml similarity index 94% rename from crates/oakotio/Cargo.toml rename to crates/oak-otio/Cargo.toml index 30a764dfe..a2435431d 100644 --- a/crates/oakotio/Cargo.toml +++ b/crates/oak-otio/Cargo.toml @@ -15,8 +15,8 @@ # along with this program. If not, see . [package] -name = "oakotio" -version = "0.1.0" +name = "oak-otio" +version.workspace = true edition = "2021" description = "Oak Video Editor OpenTimelineIO binding crate: pure-Rust serde model of the OTIO JSON format used by project load/save (src/task/src/project/loadotio, saveotio)" license = "GPL-3.0-or-later" @@ -35,7 +35,7 @@ serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["preserve_order"] } # Shared value types (Rational). Same path dependency the other bindings use. -oakcore-rs = { path = "../oakcore" } +oak-core = { path = "../oak-core" } # quick-xml: streaming XML codec for the FCPXML interchange layer # (src/fcpxml.rs). Same major version the other Rust modules use @@ -49,4 +49,4 @@ thiserror = "2" # oakcore-rs: exact Rational comparisons in the integration tests # (tests/fcpxml.rs). -oakcore-rs = { path = "../oakcore" } +oak-core = { path = "../oak-core" } diff --git a/crates/oakotio/README.md b/crates/oak-otio/README.md similarity index 100% rename from crates/oakotio/README.md rename to crates/oak-otio/README.md diff --git a/crates/oakotio/src/error.rs b/crates/oak-otio/src/error.rs similarity index 100% rename from crates/oakotio/src/error.rs rename to crates/oak-otio/src/error.rs diff --git a/crates/oakotio/src/fcpxml.rs b/crates/oak-otio/src/fcpxml.rs similarity index 99% rename from crates/oakotio/src/fcpxml.rs rename to crates/oak-otio/src/fcpxml.rs index 4315bcd15..b6af66cde 100644 --- a/crates/oakotio/src/fcpxml.rs +++ b/crates/oak-otio/src/fcpxml.rs @@ -38,7 +38,7 @@ //! //! Time values ("100/3000s", "0s", "1001/30000s", ...) are rational //! seconds; they are converted to/from `RationalTime` through -//! `oakcore_rs::Rational` with exact rational arithmetic, so NTSC rates +//! `oak_core::Rational` with exact rational arithmetic, so NTSC rates //! (30000/1001, 60000/1001, ...) stay frame accurate in both directions. //! //! The reader is deliberately lenient: unknown elements and attributes are @@ -57,7 +57,7 @@ use std::collections::HashMap; use std::fmt; use std::path::Path; -use oakcore_rs::Rational; +use oak_core::Rational; use quick_xml::escape; use quick_xml::events::{BytesDecl, BytesEnd, BytesStart, BytesText, Event}; use quick_xml::Reader; diff --git a/crates/oakotio/src/lib.rs b/crates/oak-otio/src/lib.rs similarity index 100% rename from crates/oakotio/src/lib.rs rename to crates/oak-otio/src/lib.rs diff --git a/crates/oakotio/src/model.rs b/crates/oak-otio/src/model.rs similarity index 99% rename from crates/oakotio/src/model.rs rename to crates/oak-otio/src/model.rs index 31d40a96a..6b85876ac 100644 --- a/crates/oakotio/src/model.rs +++ b/crates/oak-otio/src/model.rs @@ -42,7 +42,7 @@ use std::collections::BTreeMap; use std::path::Path; -use oakcore_rs::Rational; +use oak_core::Rational; use serde::de::{self, Deserialize, Deserializer}; use serde::ser::{Serialize, Serializer}; use serde_json::Value; @@ -1015,7 +1015,7 @@ impl<'de> Deserialize<'de> for Serializable { // --------------------------------------------------------------------------- /// `olive::core::Rational::from_double` (core/src/util/rational.cpp), ported -/// on top of `oakcore_rs::Rational::new`. `Rational::new` applies the exact +/// on top of `oak_core::Rational::new`. `Rational::new` applies the exact /// C++ `reduce_fraction(INT_MAX)` reduction, so the same raw numerator / /// denominator pairs yield bit-identical rationals. fn from_double(flt: f64) -> Rational { diff --git a/crates/oakotio/tests/data/floatfmt.json b/crates/oak-otio/tests/data/floatfmt.json similarity index 100% rename from crates/oakotio/tests/data/floatfmt.json rename to crates/oak-otio/tests/data/floatfmt.json diff --git a/crates/oakotio/tests/data/golden_collection.json b/crates/oak-otio/tests/data/golden_collection.json similarity index 100% rename from crates/oakotio/tests/data/golden_collection.json rename to crates/oak-otio/tests/data/golden_collection.json diff --git a/crates/oakotio/tests/data/golden_timeline.json b/crates/oak-otio/tests/data/golden_timeline.json similarity index 100% rename from crates/oakotio/tests/data/golden_timeline.json rename to crates/oak-otio/tests/data/golden_timeline.json diff --git a/crates/oakotio/tests/data/golden_typed_transition.json b/crates/oak-otio/tests/data/golden_typed_transition.json similarity index 100% rename from crates/oakotio/tests/data/golden_typed_transition.json rename to crates/oak-otio/tests/data/golden_typed_transition.json diff --git a/crates/oakotio/tests/fcpxml.rs b/crates/oak-otio/tests/fcpxml.rs similarity index 89% rename from crates/oakotio/tests/fcpxml.rs rename to crates/oak-otio/tests/fcpxml.rs index 38ed7918f..4e585efc9 100644 --- a/crates/oakotio/tests/fcpxml.rs +++ b/crates/oak-otio/tests/fcpxml.rs @@ -19,8 +19,8 @@ //! frame accuracy, error paths (corrupt XML, missing resources, unknown //! version) and lenient handling of unknown elements. -use oakcore_rs::Rational; -use oakotio::{Clip, Composable, ExternalReference, MediaReference, RationalTime, Timeline, Track}; +use oak_core::Rational; +use oak_otio::{Clip, Composable, ExternalReference, MediaReference, RationalTime, Timeline, Track}; /// The NTSC video rate 30000/1001 (~29.97 fps) as an exact rational. const NTSC_RATE: f64 = 30000.0 / 1001.0; @@ -65,7 +65,7 @@ fn synthetic_fcpxml() -> String { /// Parse the synthetic document and return its single timeline. fn parse_synthetic() -> Timeline { let timelines = - oakotio::from_fcpxml_string(&synthetic_fcpxml()).expect("parse synthetic fcpxml"); + oak_otio::from_fcpxml_string(&synthetic_fcpxml()).expect("parse synthetic fcpxml"); assert_eq!(timelines.len(), 1); timelines.into_iter().next().unwrap() } @@ -189,8 +189,8 @@ fn parse_synthetic_document() { #[test] fn model_round_trips_through_fcpxml() { let original = parse_synthetic(); - let xml = oakotio::to_fcpxml_string(&[original.clone()]).expect("export fcpxml"); - let reparsed = oakotio::from_fcpxml_string(&xml).expect("reparse exported fcpxml"); + let xml = oak_otio::to_fcpxml_string(&[original.clone()]).expect("export fcpxml"); + let reparsed = oak_otio::from_fcpxml_string(&xml).expect("reparse exported fcpxml"); assert_eq!(reparsed.len(), 1); assert_eq!(reparsed[0], original, "model survives fcpxml round trip"); } @@ -198,7 +198,7 @@ fn model_round_trips_through_fcpxml() { #[test] fn exported_document_structure() { let timeline = parse_synthetic(); - let xml = oakotio::to_fcpxml_string(&[timeline]).expect("export fcpxml"); + let xml = oak_otio::to_fcpxml_string(&[timeline]).expect("export fcpxml"); // Document scaffolding. assert!( @@ -249,13 +249,13 @@ fn ntsc_frame_accuracy() { let mut timeline = Timeline::new("NTSC"); let mut video = Track::new("Video"); let mut clip = Clip::new("ntsc"); - clip.set_source_range(oakotio::TimeRange::new( + clip.set_source_range(oak_otio::TimeRange::new( RationalTime::new(0.0, NTSC_RATE), RationalTime::new(3.0, NTSC_RATE), )); clip.set_media_reference(MediaReference::ExternalReference(ExternalReference::new( "file:///tmp/ntsc.mov", - Some(oakotio::TimeRange::new( + Some(oak_otio::TimeRange::new( RationalTime::new(0.0, NTSC_RATE), RationalTime::new(1000.0, NTSC_RATE), )), @@ -263,8 +263,8 @@ fn ntsc_frame_accuracy() { video.append_child(Composable::Clip(clip)); timeline.tracks_mut().append_child(Composable::Track(video)); - let xml = oakotio::to_fcpxml_string(&[timeline]).expect("export"); - let reparsed = oakotio::from_fcpxml_string(&xml).expect("reparse"); + let xml = oak_otio::to_fcpxml_string(&[timeline]).expect("export"); + let reparsed = oak_otio::from_fcpxml_string(&xml).expect("reparse"); let clip = reparsed[0].tracks().children()[0] .as_track() .unwrap() @@ -293,29 +293,29 @@ fn error_corrupt_xml() { // Malformed — either is a hard error. let bad = ""; assert!(matches!( - oakotio::from_fcpxml_string(bad), - Err(oakotio::FcpxmlError::Xml(_)) | Err(oakotio::FcpxmlError::Malformed(_)) + oak_otio::from_fcpxml_string(bad), + Err(oak_otio::FcpxmlError::Xml(_)) | Err(oak_otio::FcpxmlError::Malformed(_)) )); // Unclosed root element. let bad = ""; assert!(matches!( - oakotio::from_fcpxml_string(bad), - Err(oakotio::FcpxmlError::Malformed(_)) + oak_otio::from_fcpxml_string(bad), + Err(oak_otio::FcpxmlError::Malformed(_)) )); // Truly broken markup. let bad = " "#; - match oakotio::from_fcpxml_string(doc) { - Err(oakotio::FcpxmlError::Malformed(msg)) => { + match oak_otio::from_fcpxml_string(doc) { + Err(oak_otio::FcpxmlError::Malformed(msg)) => { assert!(msg.contains("nope"), "{msg}"); } other => panic!("expected Malformed error, got {other:?}"), @@ -344,8 +344,8 @@ fn error_missing_resources() { "#; assert!(matches!( - oakotio::from_fcpxml_string(doc), - Err(oakotio::FcpxmlError::Malformed(_)) + oak_otio::from_fcpxml_string(doc), + Err(oak_otio::FcpxmlError::Malformed(_)) )); } @@ -354,22 +354,22 @@ fn error_unknown_version() { // Unsupported version. let doc = ""; assert!(matches!( - oakotio::from_fcpxml_string(doc), - Err(oakotio::FcpxmlError::UnsupportedVersion(_)) + oak_otio::from_fcpxml_string(doc), + Err(oak_otio::FcpxmlError::UnsupportedVersion(_)) )); // Missing version. let doc = ""; assert!(matches!( - oakotio::from_fcpxml_string(doc), - Err(oakotio::FcpxmlError::UnsupportedVersion(_)) + oak_otio::from_fcpxml_string(doc), + Err(oak_otio::FcpxmlError::UnsupportedVersion(_)) )); // Garbage version. let doc = ""; assert!(matches!( - oakotio::from_fcpxml_string(doc), - Err(oakotio::FcpxmlError::UnsupportedVersion(_)) + oak_otio::from_fcpxml_string(doc), + Err(oak_otio::FcpxmlError::UnsupportedVersion(_)) )); } @@ -398,7 +398,7 @@ fn lenient_unknown_elements() { "#; - let timelines = oakotio::from_fcpxml_string(doc).expect("lenient document parses"); + let timelines = oak_otio::from_fcpxml_string(doc).expect("lenient document parses"); assert_eq!(timelines.len(), 1); let timeline = &timelines[0]; assert_eq!(timeline.name(), "P"); @@ -441,7 +441,7 @@ fn multiple_timelines_export_and_import() { let mut a = Timeline::new("Sequence One"); let mut track_a = Track::new("Video"); let mut clip = Clip::new("c1"); - clip.set_source_range(oakotio::TimeRange::new( + clip.set_source_range(oak_otio::TimeRange::new( RationalTime::new(0.0, 24.0), RationalTime::new(48.0, 24.0), )); @@ -455,7 +455,7 @@ fn multiple_timelines_export_and_import() { let mut b = Timeline::new("Sequence Two"); let mut track_b = Track::new("Audio"); let mut clip2 = Clip::new("c2"); - clip2.set_source_range(oakotio::TimeRange::new( + clip2.set_source_range(oak_otio::TimeRange::new( RationalTime::new(0.0, 48000.0), RationalTime::new(96000.0, 48000.0), )); @@ -466,12 +466,12 @@ fn multiple_timelines_export_and_import() { track_b.append_child(Composable::Clip(clip2)); b.tracks_mut().append_child(Composable::Track(track_b)); - let xml = oakotio::to_fcpxml_string(&[a.clone(), b.clone()]).expect("export two timelines"); + let xml = oak_otio::to_fcpxml_string(&[a.clone(), b.clone()]).expect("export two timelines"); assert!(xml.contains(""), "{xml}"); - let timelines = oakotio::from_fcpxml_string(&xml).expect("reparse"); + let timelines = oak_otio::from_fcpxml_string(&xml).expect("reparse"); assert!(timelines.is_empty()); } diff --git a/crates/oakotio/tests/parity.rs b/crates/oak-otio/tests/parity.rs similarity index 88% rename from crates/oakotio/tests/parity.rs rename to crates/oak-otio/tests/parity.rs index 2dc8d3c18..af1cbb422 100644 --- a/crates/oakotio/tests/parity.rs +++ b/crates/oak-otio/tests/parity.rs @@ -31,7 +31,7 @@ fn read_golden(name: &str) -> String { fn assert_round_trip(name: &str) { let text = read_golden(name); - let doc = oakotio::from_json_string(&text).unwrap_or_else(|e| panic!("parse {name}: {e}")); + let doc = oak_otio::from_json_string(&text).unwrap_or_else(|e| panic!("parse {name}: {e}")); let out = doc .to_json_string() .unwrap_or_else(|e| panic!("serialize {name}: {e}")); @@ -60,14 +60,14 @@ fn floatfmt_round_trips() { #[test] fn golden_timeline_parses_as_timeline_root() { - let doc = oakotio::from_json_string(&read_golden("golden_timeline.json")).unwrap(); + let doc = oak_otio::from_json_string(&read_golden("golden_timeline.json")).unwrap(); assert_eq!(doc.schema_name(), "Timeline"); assert!(doc.as_timeline().is_some()); } #[test] fn golden_collection_parses_as_collection_root() { - let doc = oakotio::from_json_string(&read_golden("golden_collection.json")).unwrap(); + let doc = oak_otio::from_json_string(&read_golden("golden_collection.json")).unwrap(); assert_eq!(doc.schema_name(), "SerializableCollection"); assert!(doc.as_collection().is_some()); } diff --git a/crates/oakotio/tests/save_parity.rs b/crates/oak-otio/tests/save_parity.rs similarity index 97% rename from crates/oakotio/tests/save_parity.rs rename to crates/oak-otio/tests/save_parity.rs index f07034643..66e230a17 100644 --- a/crates/oakotio/tests/save_parity.rs +++ b/crates/oak-otio/tests/save_parity.rs @@ -19,7 +19,7 @@ //! byte for byte. This proves the writer (not just the reader) reproduces //! the opentimelineio C++ output. -use oakotio::{ +use oak_otio::{ Clip, Composable, ExternalReference, Gap, MediaReference, RationalTime, TimeRange, Timeline, Track, Transition, }; @@ -102,7 +102,7 @@ fn saved_timeline_reparses_identically() { // The builder output must also parse back into an equivalent graph. let built = build_golden_timeline(); let out = built.to_json_string().unwrap(); - let reparsed = oakotio::from_json_string(&out).unwrap(); + let reparsed = oak_otio::from_json_string(&out).unwrap(); assert_eq!( reparsed.as_timeline().unwrap().name(), "My Sequence", diff --git a/crates/oakotio/tests/semantic.rs b/crates/oak-otio/tests/semantic.rs similarity index 96% rename from crates/oakotio/tests/semantic.rs rename to crates/oak-otio/tests/semantic.rs index a790a0565..1a7bca4d8 100644 --- a/crates/oakotio/tests/semantic.rs +++ b/crates/oak-otio/tests/semantic.rs @@ -17,7 +17,7 @@ //! Semantic tests over `golden_timeline.json`: walk the parsed object graph //! and assert the values Oak's C++ load task depends on. -use oakotio::{Clip, ExternalReference, MediaReference, Serializable, Timeline}; +use oak_otio::{Clip, ExternalReference, MediaReference, Serializable, Timeline}; fn golden_timeline() -> Timeline { let text = std::fs::read_to_string(concat!( @@ -25,7 +25,7 @@ fn golden_timeline() -> Timeline { "/tests/data/golden_timeline.json" )) .expect("read golden_timeline.json"); - match oakotio::from_json_string(&text).expect("parse golden_timeline.json") { + match oak_otio::from_json_string(&text).expect("parse golden_timeline.json") { Serializable::Timeline(t) => t, other => panic!("expected Timeline root, got {}", other.schema_name()), } diff --git a/crates/oakplugin/Cargo.lock b/crates/oak-plugin/Cargo.lock similarity index 100% rename from crates/oakplugin/Cargo.lock rename to crates/oak-plugin/Cargo.lock diff --git a/crates/oakplugin/Cargo.toml b/crates/oak-plugin/Cargo.toml similarity index 86% rename from crates/oakplugin/Cargo.toml rename to crates/oak-plugin/Cargo.toml index cbce31511..d35156da6 100644 --- a/crates/oakplugin/Cargo.toml +++ b/crates/oak-plugin/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakplugin" -version = "0.1.0" +name = "oak-plugin" +version.workspace = true edition = "2021" description = "Oak Video Editor plugin module: self-contained OFX host and plugin bridge (Rust)" license = "GPL-3.0-or-later" @@ -15,10 +15,10 @@ crate-type = ["staticlib", "rlib"] # 共享 ABI 类型(CHandle 等,单库化统一,见 docs/zh/plans/riir/single-lib.md)。 # 模块桥改直接 Rust 调用(单库化,见 docs/zh/plans/riir/single-lib.md); # 只允许零依赖起步。确需引入的 crate 必须在 README 登记理由。 -oakcore-rs = { path = "../oakcore" } -oakundo = { path = "../oakundo" } -oaknode = { path = "../oaknode" } -oakrender = { path = "../oakrender" } +oak-core = { path = "../oak-core" } + oak-undo = { path = "../oak-undo" } +oak-node = { path = "../oak-node" } +oak-render = { path = "../oak-render" } # Error derive(Display + std::error::Error,见 src/error.rs);理由已登记 README。 thiserror = "2" diff --git a/crates/oakplugin/README.md b/crates/oak-plugin/README.md similarity index 100% rename from crates/oakplugin/README.md rename to crates/oak-plugin/README.md diff --git a/crates/oakplugin/build.rs b/crates/oak-plugin/build.rs similarity index 100% rename from crates/oakplugin/build.rs rename to crates/oak-plugin/build.rs diff --git a/crates/oakplugin/cbits/oak_test_plugin.c b/crates/oak-plugin/cbits/oak_test_plugin.c similarity index 100% rename from crates/oakplugin/cbits/oak_test_plugin.c rename to crates/oak-plugin/cbits/oak_test_plugin.c diff --git a/crates/oakplugin/cbits/ofx_message_shim.c b/crates/oak-plugin/cbits/ofx_message_shim.c similarity index 100% rename from crates/oakplugin/cbits/ofx_message_shim.c rename to crates/oak-plugin/cbits/ofx_message_shim.c diff --git a/crates/oakplugin/cbits/ofx_param_shim.c b/crates/oak-plugin/cbits/ofx_param_shim.c similarity index 100% rename from crates/oakplugin/cbits/ofx_param_shim.c rename to crates/oak-plugin/cbits/ofx_param_shim.c diff --git a/crates/oakplugin/examples/scan_probe.rs b/crates/oak-plugin/examples/scan_probe.rs similarity index 76% rename from crates/oakplugin/examples/scan_probe.rs rename to crates/oak-plugin/examples/scan_probe.rs index e8bcd553a..7badca8d4 100644 --- a/crates/oakplugin/examples/scan_probe.rs +++ b/crates/oak-plugin/examples/scan_probe.rs @@ -2,16 +2,16 @@ //! host actually discovers (diagnosing why the effect library is empty). fn main() { - let host = oakplugin::host::Host::global(); + let host = oak_plugin::host::Host::global(); match host.cache.scan() { Ok(()) => println!("scan: ok"), Err(e) => println!("scan: FAILED: {e}"), } println!("plugins discovered: {}", host.cache.count()); // Direct probe: read the host-level props through the C suite table. - let suite = oakplugin::suites::property::suite_v1(); + let suite = oak_plugin::suites::property::suite_v1(); unsafe { - let handle = &host.props as *const oakplugin::property::PropertySet as *mut std::ffi::c_void; + let handle = &host.props as *const oak_plugin::property::PropertySet as *mut std::ffi::c_void; let name = std::ffi::CString::new("OfxPropName").unwrap(); let mut out: *mut std::ffi::c_char = std::ptr::null_mut(); let stat = (suite.get_string)(handle, name.as_ptr(), 0, &mut out); @@ -20,7 +20,7 @@ fn main() { println!(" value: {:?}", std::ffi::CStr::from_ptr(out)); } } - let registered = oakplugin::node_factory::register_plugin_nodes(); + let registered = oak_plugin::node_factory::register_plugin_nodes(); println!("factory node types registered: {}", registered.len()); for id in ®istered { println!(" type_id={id}"); diff --git a/crates/oakplugin/ofx/ofx-native-v1.5_aces-v1.3_ocio-v2.3.h b/crates/oak-plugin/ofx/ofx-native-v1.5_aces-v1.3_ocio-v2.3.h similarity index 100% rename from crates/oakplugin/ofx/ofx-native-v1.5_aces-v1.3_ocio-v2.3.h rename to crates/oak-plugin/ofx/ofx-native-v1.5_aces-v1.3_ocio-v2.3.h diff --git a/crates/oakplugin/ofx/ofxColour.h b/crates/oak-plugin/ofx/ofxColour.h similarity index 100% rename from crates/oakplugin/ofx/ofxColour.h rename to crates/oak-plugin/ofx/ofxColour.h diff --git a/crates/oakplugin/ofx/ofxCore.h b/crates/oak-plugin/ofx/ofxCore.h similarity index 100% rename from crates/oakplugin/ofx/ofxCore.h rename to crates/oak-plugin/ofx/ofxCore.h diff --git a/crates/oakplugin/ofx/ofxDrawSuite.h b/crates/oak-plugin/ofx/ofxDrawSuite.h similarity index 100% rename from crates/oakplugin/ofx/ofxDrawSuite.h rename to crates/oak-plugin/ofx/ofxDrawSuite.h diff --git a/crates/oakplugin/ofx/ofxGPURender.h b/crates/oak-plugin/ofx/ofxGPURender.h similarity index 100% rename from crates/oakplugin/ofx/ofxGPURender.h rename to crates/oak-plugin/ofx/ofxGPURender.h diff --git a/crates/oakplugin/ofx/ofxImageEffect.h b/crates/oak-plugin/ofx/ofxImageEffect.h similarity index 100% rename from crates/oakplugin/ofx/ofxImageEffect.h rename to crates/oak-plugin/ofx/ofxImageEffect.h diff --git a/crates/oakplugin/ofx/ofxInteract.h b/crates/oak-plugin/ofx/ofxInteract.h similarity index 100% rename from crates/oakplugin/ofx/ofxInteract.h rename to crates/oak-plugin/ofx/ofxInteract.h diff --git a/crates/oakplugin/ofx/ofxKeySyms.h b/crates/oak-plugin/ofx/ofxKeySyms.h similarity index 100% rename from crates/oakplugin/ofx/ofxKeySyms.h rename to crates/oak-plugin/ofx/ofxKeySyms.h diff --git a/crates/oakplugin/ofx/ofxMemory.h b/crates/oak-plugin/ofx/ofxMemory.h similarity index 100% rename from crates/oakplugin/ofx/ofxMemory.h rename to crates/oak-plugin/ofx/ofxMemory.h diff --git a/crates/oakplugin/ofx/ofxMessage.h b/crates/oak-plugin/ofx/ofxMessage.h similarity index 100% rename from crates/oakplugin/ofx/ofxMessage.h rename to crates/oak-plugin/ofx/ofxMessage.h diff --git a/crates/oakplugin/ofx/ofxMultiThread.h b/crates/oak-plugin/ofx/ofxMultiThread.h similarity index 100% rename from crates/oakplugin/ofx/ofxMultiThread.h rename to crates/oak-plugin/ofx/ofxMultiThread.h diff --git a/crates/oakplugin/ofx/ofxParam.h b/crates/oak-plugin/ofx/ofxParam.h similarity index 100% rename from crates/oakplugin/ofx/ofxParam.h rename to crates/oak-plugin/ofx/ofxParam.h diff --git a/crates/oakplugin/ofx/ofxPixels.h b/crates/oak-plugin/ofx/ofxPixels.h similarity index 100% rename from crates/oakplugin/ofx/ofxPixels.h rename to crates/oak-plugin/ofx/ofxPixels.h diff --git a/crates/oakplugin/ofx/ofxProgress.h b/crates/oak-plugin/ofx/ofxProgress.h similarity index 100% rename from crates/oakplugin/ofx/ofxProgress.h rename to crates/oak-plugin/ofx/ofxProgress.h diff --git a/crates/oakplugin/ofx/ofxProperty.h b/crates/oak-plugin/ofx/ofxProperty.h similarity index 100% rename from crates/oakplugin/ofx/ofxProperty.h rename to crates/oak-plugin/ofx/ofxProperty.h diff --git a/crates/oakplugin/src/clip.rs b/crates/oak-plugin/src/clip.rs similarity index 96% rename from crates/oakplugin/src/clip.rs rename to crates/oak-plugin/src/clip.rs index 3d7926512..08859cb09 100644 --- a/crates/oakplugin/src/clip.rs +++ b/crates/oak-plugin/src/clip.rs @@ -24,7 +24,7 @@ //! clip handle 即 `&props`)。 //! //! 单库化后 oakrender 的 ffi 已删除:帧访问走 -//! [`oakrender::texture::Texture::to_frame`] 值路径(GPU 纹理经后端 +//! [`oak_render::texture::Texture::to_frame`] 值路径(GPU 纹理经后端 //! 下载、CPU 纹理克隆),帧释放随值 drop 自动发生(原 //! `texture_get_frame`/`frame_free` 句柄调用面随桩删除)。 @@ -217,8 +217,8 @@ impl ClipInstance { let format = params.format; if format != PIXEL_FORMAT_F32 && format != crate::render::PIXEL_FORMAT_U8 - && format != oakcore_rs::PixelFormat::U16 as i32 - && format != oakcore_rs::PixelFormat::F16 as i32 + && format != oak_core::PixelFormat::U16 as i32 + && format != oak_core::PixelFormat::F16 as i32 { return Err(Error::Failed(format!( "输入帧格式 {format} 不支持(仅 U8/U16/F16/F32)" @@ -253,8 +253,8 @@ impl ClipInstance { let samples_per_row = (w as usize) * channels; let src_bpc = match format { f if f == crate::render::PIXEL_FORMAT_U8 => 1, - f if f == oakcore_rs::PixelFormat::U16 as i32 => 2, - f if f == oakcore_rs::PixelFormat::F16 as i32 => 2, + f if f == oak_core::PixelFormat::U16 as i32 => 2, + f if f == oak_core::PixelFormat::F16 as i32 => 2, _ => 4, }; let tight_src = samples_per_row * src_bpc; @@ -270,12 +270,12 @@ impl ClipInstance { f if f == crate::render::PIXEL_FORMAT_U8 => { src_bytes[s + i] as f32 / 255.0 } - f if f == oakcore_rs::PixelFormat::U16 as i32 => { + f if f == oak_core::PixelFormat::U16 as i32 => { let off = s + i * 2; let bits = u16::from_le_bytes([src_bytes[off], src_bytes[off + 1]]); bits as f32 / 65535.0 } - f if f == oakcore_rs::PixelFormat::F16 as i32 => { + f if f == oak_core::PixelFormat::F16 as i32 => { let off = s + i * 2; let bits = u16::from_le_bytes([src_bytes[off], src_bytes[off + 1]]); let v = f16_to_f32(bits); @@ -318,7 +318,7 @@ impl ClipInstance { /// 输出纹理由 oakrender 侧创建并经 [`Self::set_output_texture`] /// 挂入——本函数取该纹理的 CPU 帧(GPU 纹理经后端下载,写回后 /// 对 `Texture::Gpu` 再经 - /// [`oakrender::backend::GpuContextLike::upload`] 上传),按帧 + /// [`oak_render::backend::GpuContextLike::upload`] 上传),按帧 /// 参数校验 F32 与尺寸后整帧拷贝图像像素(全链路 F32;C++ /// pluginrenderer 的 `readback/wrap` 路径第 1 期以 CPU 拷贝表达, /// GL 走 [`crate::render`] 的 `// [P2]`)。未挂输出纹理 @@ -381,7 +381,7 @@ impl ClipInstance { /// 本 clip 的时间域(clipGetFrameRange)。 /// /// `// TODO(value-model)`:输入范围经 oakrender 帧的时间基推导 - /// (time_base)——随 clip 迁移到 `oakrender::texture::Texture` + /// (time_base)——随 clip 迁移到 `oak_render::texture::Texture` /// 值模型落地。 pub fn frame_range(&self) -> crate::error::Result { let _ = OfxRangeD::default(); diff --git a/crates/oakplugin/src/descriptor.rs b/crates/oak-plugin/src/descriptor.rs similarity index 100% rename from crates/oakplugin/src/descriptor.rs rename to crates/oak-plugin/src/descriptor.rs diff --git a/crates/oakplugin/src/error.rs b/crates/oak-plugin/src/error.rs similarity index 100% rename from crates/oakplugin/src/error.rs rename to crates/oak-plugin/src/error.rs diff --git a/crates/oakplugin/src/gl_bridge.rs b/crates/oak-plugin/src/gl_bridge.rs similarity index 100% rename from crates/oakplugin/src/gl_bridge.rs rename to crates/oak-plugin/src/gl_bridge.rs diff --git a/crates/oakplugin/src/handle.rs b/crates/oak-plugin/src/handle.rs similarity index 100% rename from crates/oakplugin/src/handle.rs rename to crates/oak-plugin/src/handle.rs diff --git a/crates/oakplugin/src/host.rs b/crates/oak-plugin/src/host.rs similarity index 100% rename from crates/oakplugin/src/host.rs rename to crates/oak-plugin/src/host.rs diff --git a/crates/oakplugin/src/image.rs b/crates/oak-plugin/src/image.rs similarity index 100% rename from crates/oakplugin/src/image.rs rename to crates/oak-plugin/src/image.rs diff --git a/crates/oakplugin/src/instance.rs b/crates/oak-plugin/src/instance.rs similarity index 99% rename from crates/oakplugin/src/instance.rs rename to crates/oak-plugin/src/instance.rs index ad0afdb2b..4e3c59fd7 100644 --- a/crates/oakplugin/src/instance.rs +++ b/crates/oak-plugin/src/instance.rs @@ -36,7 +36,7 @@ pub struct EditTransaction { /// 嵌套深度(editBegin/End 必须配对)。 depth: i32, /// 事务累积的 multi 命令(None = 尚无子命令)。 - multi: Option, + multi: Option, /// 事务内回写次数(标签计数)。 param_count: i32, /// 第一条回写的标签。 @@ -145,7 +145,7 @@ impl Drop for Instance { impl Instance { /// 绑定 oaknode 节点(C++ `set_node_handle` 的 Rust 侧;装配期由 /// facade/测试调用)。`identity` 为 [`crate::node::register_node`] - /// 返回的 oaknode 节点身份([`oaknode::id::NodeId::identity`] 的 + /// 返回的 oaknode 节点身份([`oak_node::id::NodeId::identity`] 的 /// 打包值,经 [`crate::node::node_from_identity`] 反查); /// 0 解除绑定。 pub fn bind_node(&self, identity: usize) { @@ -192,11 +192,11 @@ impl Instance { /// oliveplugininstance.cpp:390-414 `submit_undo_command`): /// 编辑事务内并入 multi(子命令立即 redo 生效,值即时可见), /// 否则单命令 redo 后释放。 - pub(crate) fn submit_undo_command(&self, mut cmd: oakundo::undocommand::UndoCommand, label: &str) { + pub(crate) fn submit_undo_command(&self, mut cmd: oak_undo::undocommand::UndoCommand, label: &str) { if self.in_edit() { let mut e = self.edit.lock().unwrap_or_else(|e| e.into_inner()); if e.multi.is_none() { - e.multi = Some(oakundo::undocommand::UndoCommand::multi()); + e.multi = Some(oak_undo::undocommand::UndoCommand::multi()); } e.param_count += 1; if e.first_label.is_empty() { diff --git a/crates/oakplugin/src/lib.rs b/crates/oak-plugin/src/lib.rs similarity index 97% rename from crates/oakplugin/src/lib.rs rename to crates/oak-plugin/src/lib.rs index b70a83d97..febf6db68 100644 --- a/crates/oakplugin/src/lib.rs +++ b/crates/oak-plugin/src/lib.rs @@ -24,7 +24,7 @@ //! - **桥**:把 OFX 实例的参数接到 oaknode([`node`],节点值 POD + //! 身份注册表与 undoable 回写)、把 clip 的输入输出接到 oakrender //! 纹理([`render`],纹理/帧/渲染器值类型)、把参数修改包成 undo -//! 命令(直接经 `oakundo::undocommand::UndoCommand`,见 +//! 命令(直接经 `oak_undo::undocommand::UndoCommand`,见 //! [`instance::Instance::submit_undo_command`])。 //! //! ## 单库化(single-lib unification) diff --git a/crates/oakplugin/src/node.rs b/crates/oak-plugin/src/node.rs similarity index 86% rename from crates/oakplugin/src/node.rs rename to crates/oak-plugin/src/node.rs index 6c27a8355..213be46f6 100644 --- a/crates/oakplugin/src/node.rs +++ b/crates/oak-plugin/src/node.rs @@ -29,12 +29,12 @@ //! ## 身份注册表(单库化重建) //! //! oaknode 的 C ABI 已删除(单库化):节点对象是 -//! `oaknode::project::Project`(Arc>)里的 -//! `oaknode::graph::Graph` 条目,按 [`oaknode::id::NodeId`] 定位。 +//! `oak_node::project::Project`(Arc>)里的 +//! `oak_node::graph::Graph` 条目,按 [`oak_node::id::NodeId`] 定位。 //! 本 crate 的 [`NodeRef`] 即旧句柄盒 //! `(Arc>, NodeId)` 的值型复刻;进程级注册表 //! [`register_node`]/[`node_from_identity`] 按 -//! [`oaknode::id::NodeId::identity`] 的打包身份(u64)做弱引用 +//! [`oak_node::id::NodeId::identity`] 的打包身份(u64)做弱引用 //! 映射(project 释放后条目自然失效,升级失败 → None)—— //! 对应 M9 C++ 版 `oaknode_node_identity()` 注册表的地址语义。 //! facade 装配期调 [`register_node`] 登记节点,把返回身份写进 @@ -43,9 +43,9 @@ //! ## undoable 回写 //! //! [`set_input_undoable`]/[`set_input_string_undoable`] 按 -//! `oaknode::ops::set_value_at_time_command` 的同一 closure +//! `oak_node::ops::set_value_at_time_command` 的同一 closure //! 模式(`command_from_closures`)构造未执行的 -//! `oakundo::undocommand::UndoCommand`:redo 闭包锁 project、 +//! `oak_undo::undocommand::UndoCommand`:redo 闭包锁 project、 //! `graph.get_mut(id)`、`NodeCore::set_standard_value` 写标准值; //! undo 闭包回放创建期快照的旧值。命令由调用方 //! ([`crate::param::notify_instance_changed`] → @@ -54,16 +54,16 @@ use std::collections::HashMap; use std::sync::{Arc, Mutex, OnceLock, Weak}; -use oakundo::undocommand::UndoCommand; +use oak_undo::undocommand::UndoCommand; /// oaknode 节点引用(single-lib):旧 C ABI 句柄盒 /// `(Arc>, NodeId)` 的值型复刻。 #[derive(Clone)] pub struct NodeRef { /// 所属 project(节点生命周期随 project)。 - pub project: Arc>, + pub project: Arc>, /// 节点在 project.graph 里的 id。 - pub id: oaknode::id::NodeId, + pub id: oak_node::id::NodeId, } /// oaknode_value_type 的取值(node.h:74)。 @@ -189,18 +189,18 @@ impl Value { } } - /// POD → [`oaknode::value::NodeValue`],按 POD kind 映射(与 - /// `oaknode::value::OakNodeValue::to_node_value` 的 kind 分支一致, + /// POD → [`oak_node::value::NodeValue`],按 POD kind 映射(与 + /// `oak_node::value::OakNodeValue::to_node_value` 的 kind 分支一致, /// 不按声明类型重量化)。`STRING` 族 POD 不携带数据 → `None`; - /// `NONE` → [`oaknode::value::NodeValue::None`]。 - pub fn to_node_value(&self) -> Option { - use oaknode::value::NodeValue as NV; + /// `NONE` → [`oak_node::value::NodeValue::None`]。 + pub fn to_node_value(&self) -> Option { + use oak_node::value::NodeValue as NV; match self.r#type { node_value_type::NONE => Some(NV::None), node_value_type::INT => Some(NV::Int(self.num)), node_value_type::FLOAT => Some(NV::Float(self.f[0])), node_value_type::BOOL => Some(NV::Boolean(self.num != 0)), - node_value_type::RATIONAL => Some(NV::Rational(oakcore_rs::Rational::new( + node_value_type::RATIONAL => Some(NV::Rational(oak_core::Rational::new( self.num, self.den, ))), node_value_type::COLOR => Some(NV::Color(self.f)), @@ -212,10 +212,10 @@ impl Value { } } - /// [`oaknode::value::NodeValue`] → POD(`ValueType::to_oak` 的逆)。 + /// [`oak_node::value::NodeValue`] → POD(`ValueType::to_oak` 的逆)。 /// 无 POD 表达的类型(字符串族/纹理/采样/矩阵等)→ `None`。 - pub fn from_node_value(v: &oaknode::value::NodeValue) -> Option { - use oaknode::value::NodeValue as NV; + pub fn from_node_value(v: &oak_node::value::NodeValue) -> Option { + use oak_node::value::NodeValue as NV; Some(match v { NV::None => Value { r#type: node_value_type::NONE, @@ -248,9 +248,9 @@ impl Value { /// + 节点 id。 struct RegistryEntry { /// 所属 project(弱引用;强引用由调用方/节点持有)。 - project: Weak>, + project: Weak>, /// 节点 id。 - id: oaknode::id::NodeId, + id: oak_node::id::NodeId, } /// 进程级身份注册表(OnceLock 惰性初始化;测试进程内可重复 register)。 @@ -262,12 +262,12 @@ fn registry() -> &'static Mutex> { /// 登记 oaknode 节点(facade 装配期调用;对应 M9 C++ 版 /// `oaknode_node_identity()` 注册表的登记侧)。返回打包身份 -/// ([`oaknode::id::NodeId::identity`]),写入 +/// ([`oak_node::id::NodeId::identity`]),写入 /// [`crate::instance::Instance::bind_node`]。同一身份重复登记 /// 覆盖旧条目(重绑定)。 pub fn register_node( - project: Arc>, - id: oaknode::id::NodeId, + project: Arc>, + id: oak_node::id::NodeId, ) -> u64 { let identity = id.identity(); let entry = RegistryEntry { @@ -332,7 +332,7 @@ fn lock_any(m: &Mutex) -> std::sync::MutexGuard<'_, T> { } /// 从 redo/undo 闭包构造未执行的 [`UndoCommand`](closure 模式,与 -/// `oaknode::ops::command_from_closures` 同构)。 +/// `oak_node::ops::command_from_closures` 同构)。 fn command_from_closures( redo: impl FnMut() + Send + 'static, undo: impl FnMut() + Send + 'static, @@ -346,7 +346,7 @@ fn command_from_closures( /// [`crate::instance::Instance::submit_undo_command`] 提交):redo /// 锁 project、`graph.get_mut(id)`、`NodeCore::set_standard_value` /// 写新值;undo 回放创建期快照的旧值(与 -/// `oaknode::ops::set_value_at_time_command` 的 standard-value 分支 +/// `oak_node::ops::set_value_at_time_command` 的 standard-value 分支 /// 同构,element = -1 整值)。节点/输入失效时返回 /// [`NodeBridgeError`](不产出命令)。 pub fn set_input_undoable( @@ -401,10 +401,10 @@ pub fn set_input_undoable( /// 以 undoable 方式设置节点的标准输入值(字符串族输入:Text / /// StrCombo / Parametric——POD 不携带字符串数据)。 /// -/// 按输入的声明类型([`oaknode::value::ValueType`])选存储变体: -/// `StrCombo` → [`oaknode::value::NodeValue::StrCombo`], +/// 按输入的声明类型([`oak_node::value::ValueType`])选存储变体: +/// `StrCombo` → [`oak_node::value::NodeValue::StrCombo`], /// `Text` / `Parametric`(值 = 曲线 JSON 文本)→ -/// [`oaknode::value::NodeValue::Text`]。声明类型不是字符串族 → +/// [`oak_node::value::NodeValue::Text`]。声明类型不是字符串族 → /// [`NodeBridgeError::NotStringInput`]。命令语义与 /// [`set_input_undoable`] 相同。 pub fn set_input_string_undoable( @@ -425,9 +425,9 @@ pub fn set_input_string_undoable( (entry.core.standard_value(input, -1), declared) }; let nv = match declared { - oaknode::value::ValueType::StrCombo => oaknode::value::NodeValue::StrCombo(value.to_string()), - oaknode::value::ValueType::Text | oaknode::value::ValueType::Parametric => { - oaknode::value::NodeValue::Text(value.to_string()) + oak_node::value::ValueType::StrCombo => oak_node::value::NodeValue::StrCombo(value.to_string()), + oak_node::value::ValueType::Text | oak_node::value::ValueType::Parametric => { + oak_node::value::NodeValue::Text(value.to_string()) } _ => return Err(NodeBridgeError::NotStringInput(input.to_string())), }; @@ -464,30 +464,30 @@ mod tests { use super::*; /// 建一个含 Text/StrCombo/Float 输入的测试节点。 - fn test_project() -> (Arc>, oaknode::id::NodeId) { - let project = oaknode::project::Project::new(); + fn test_project() -> (Arc>, oak_node::id::NodeId) { + let project = oak_node::project::Project::new(); let mut guard = project.lock().unwrap(); let id = guard.graph.add_node( - oaknode::node::NodeCore::empty(), - Box::new(oaknode::nodes::EmptyBehavior), + oak_node::node::NodeCore::empty(), + Box::new(oak_node::nodes::EmptyBehavior), ); // NodeCore::empty 无输入;手动声明三种输入。 - use oaknode::input::Input; + use oak_node::input::Input; let core = guard.graph.get_mut(id).unwrap(); core.core.add_input(Input::new( "label", - oaknode::value::ValueType::Text, - oaknode::value::NodeValue::Text(String::new()), + oak_node::value::ValueType::Text, + oak_node::value::NodeValue::Text(String::new()), )); core.core.add_input(Input::new( "choice", - oaknode::value::ValueType::StrCombo, - oaknode::value::NodeValue::StrCombo(String::new()), + oak_node::value::ValueType::StrCombo, + oak_node::value::NodeValue::StrCombo(String::new()), )); core.core.add_input(Input::new( "opacity", - oaknode::value::ValueType::Float, - oaknode::value::NodeValue::Float(1.0), + oak_node::value::ValueType::Float, + oak_node::value::NodeValue::Float(1.0), )); drop(guard); (project, id) @@ -529,7 +529,7 @@ mod tests { /// Value POD ↔ NodeValue 全类型映射;STRING 族 POD 无数据。 #[test] fn pod_node_value_roundtrip() { - use oaknode::value::NodeValue as NV; + use oak_node::value::NodeValue as NV; let cases: Vec<(Value, NV)> = vec![ (Value::int(7), NV::Int(7)), (Value::float(1.5), NV::Float(1.5)), @@ -542,7 +542,7 @@ mod tests { den: 2, f: [0.0; 4], }, - NV::Rational(oakcore_rs::Rational::new(3, 2)), + NV::Rational(oak_core::Rational::new(3, 2)), ), (Value::color(0.1, 0.2, 0.3, 0.4), NV::Color([0.1, 0.2, 0.3, 0.4])), (Value::vec(&[1.0, 2.0]), NV::Vec2([1.0, 2.0])), @@ -583,7 +583,7 @@ mod tests { .unwrap() .core .standard_value("opacity", -1), - oaknode::value::NodeValue::Float(1.0) + oak_node::value::NodeValue::Float(1.0) ); cmd.redo_now(); assert_eq!( @@ -595,7 +595,7 @@ mod tests { .unwrap() .core .standard_value("opacity", -1), - oaknode::value::NodeValue::Float(0.25) + oak_node::value::NodeValue::Float(0.25) ); cmd.undo_now(); assert_eq!( @@ -607,7 +607,7 @@ mod tests { .unwrap() .core .standard_value("opacity", -1), - oaknode::value::NodeValue::Float(1.0) + oak_node::value::NodeValue::Float(1.0) ); // 未知输入 / STRING POD / 失效节点。 @@ -621,7 +621,7 @@ mod tests { )); let stale = NodeRef { project, - id: oaknode::id::NodeId::from_identity(999).unwrap(), + id: oak_node::id::NodeId::from_identity(999).unwrap(), }; assert!(matches!( set_input_undoable(&stale, "opacity", &Value::float(1.0)), @@ -648,7 +648,7 @@ mod tests { .unwrap() .core .standard_value("label", -1), - oaknode::value::NodeValue::Text("hello".to_string()) + oak_node::value::NodeValue::Text("hello".to_string()) ); cmd.undo_now(); assert_eq!( @@ -660,7 +660,7 @@ mod tests { .unwrap() .core .standard_value("label", -1), - oaknode::value::NodeValue::Text(String::new()) + oak_node::value::NodeValue::Text(String::new()) ); let mut cmd = set_input_string_undoable(&node, "choice", "low").unwrap(); @@ -674,7 +674,7 @@ mod tests { .unwrap() .core .standard_value("choice", -1), - oaknode::value::NodeValue::StrCombo("low".to_string()) + oak_node::value::NodeValue::StrCombo("low".to_string()) ); // 数值输入走字符串 setter → NotStringInput。 diff --git a/crates/oakplugin/src/node_factory.rs b/crates/oak-plugin/src/node_factory.rs similarity index 97% rename from crates/oakplugin/src/node_factory.rs rename to crates/oak-plugin/src/node_factory.rs index 4b9cffc52..30df2d8c7 100644 --- a/crates/oakplugin/src/node_factory.rs +++ b/crates/oak-plugin/src/node_factory.rs @@ -20,11 +20,11 @@ //! (factory.cpp:148-186)+ `PluginNode::PluginNode(Instance*)` 的 //! 参数翻译构造函数(engine/node/plugins/plugin.cpp:274-514)。 //! OFX 类型只存在于本 crate,故翻译放这里;oaknode 侧只承载行为 -//! ([`oaknode::nodes::plugin::PluginNode`])——这是依赖方向 +//! ([`oak_node::nodes::plugin::PluginNode`])——这是依赖方向 //! (oakplugin → oakrender → oaknode)强加的拆分。 //! //! 职责: -//! - **实例注册表**:节点持 [`oaknode::nodes::plugin::PluginInstanceHandle`] +//! - **实例注册表**:节点持 [`oak_node::nodes::plugin::PluginInstanceHandle`] //! (u64 键),这里持 `Arc>`(C++ 的工厂实例在库 //! 条目内存活;Rust 侧等价于注册表进程级存活)。 //! - **参数翻译**:15 类 OFX 参数 → oaknode 输入(类型表逐字对齐 @@ -44,13 +44,13 @@ use std::ffi::CString; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex, OnceLock}; -use oaknode::factory::{DynNodeConstructor, DynamicNodeMeta}; -use oaknode::input::{flags as input_flags, Input}; -use oaknode::node::{Category, NodeBehavior, NodeCore}; -use oaknode::nodes::plugin::{ +use oak_node::factory::{DynNodeConstructor, DynamicNodeMeta}; +use oak_node::input::{flags as input_flags, Input}; +use oak_node::node::{Category, NodeBehavior, NodeCore}; +use oak_node::nodes::plugin::{ PluginInstanceHandle, PluginNode, SOURCE_CLIP, TEXTURE_INPUT, }; -use oaknode::value::{NodeValue, ValueType}; +use oak_node::value::{NodeValue, ValueType}; use crate::handle::RefBox; use crate::host::Host; @@ -787,7 +787,7 @@ pub fn register_plugin_nodes() -> Vec { let identifier = plugin.identifier.clone(); let create: DynNodeConstructor = Arc::new(move || { create_plugin_node(&identifier, &context) - .unwrap_or_else(oaknode::nodes::plugin::create) + .unwrap_or_else(oak_node::nodes::plugin::create) }); let meta = DynamicNodeMeta { @@ -798,7 +798,7 @@ pub fn register_plugin_nodes() -> Vec { description, create, }; - if oaknode::factory::Factory::global().register_dynamic(meta) { + if oak_node::factory::Factory::global().register_dynamic(meta) { registered.push(plugin.identifier.clone()); } } @@ -845,11 +845,11 @@ fn set_text_param(inst: &Instance, key: &str, text: &str) { /// executor 槽实现:JobSpec::Plugin → render_driver::render_frame。 fn execute_plugin_job( - req: &oakrender::eval::PluginJobRequest<'_>, -) -> oakrender::error::Result { - use oakrender::error::Error; + req: &oak_render::eval::PluginJobRequest<'_>, +) -> oak_render::error::Result { + use oak_render::error::Error; - let oakrender::eval::JobSpec::Plugin { + let oak_render::eval::JobSpec::Plugin { instance, time, effect_input_id, @@ -887,14 +887,14 @@ fn execute_plugin_job( } // 输出纹理:与输入同尺寸的 F32 帧(render_driver 校验 F32)。 - let dst_frame = oakrender::eval::generate_frame( - oakcore_rs::Rational::from_double(*time), + let dst_frame = oak_render::eval::generate_frame( + oak_core::Rational::from_double(*time), req.src.size(), - oakcore_rs::PixelFormat::F32, + oak_core::PixelFormat::F32, )?; let job = crate::render_driver::RenderJob { time: *time, - dst: oakrender::texture::Texture::wrap_frame(dst_frame), + dst: oak_render::texture::Texture::wrap_frame(dst_frame), src: Some(req.src.clone()), effect_input_id: effect_input_id.clone(), inputs: inputs.clone(), @@ -926,8 +926,8 @@ static EXECUTOR_INSTALLED: OnceLock<()> = OnceLock::new(); /// 初始化渲染管线时也可直接调。 pub fn install_render_executor() { EXECUTOR_INSTALLED.get_or_init(|| { - oakrender::eval::set_plugin_executor(Some(Arc::new(execute_plugin_job))); - oaknode::nodes::plugin::set_plugin_duplicator(Some(Arc::new(duplicate_instance))); + oak_render::eval::set_plugin_executor(Some(Arc::new(execute_plugin_job))); + oak_node::nodes::plugin::set_plugin_duplicator(Some(Arc::new(duplicate_instance))); }); } diff --git a/crates/oakplugin/src/param.rs b/crates/oak-plugin/src/param.rs similarity index 99% rename from crates/oakplugin/src/param.rs rename to crates/oak-plugin/src/param.rs index e7a59cd8a..d968142b3 100644 --- a/crates/oakplugin/src/param.rs +++ b/crates/oak-plugin/src/param.rs @@ -19,7 +19,7 @@ //! 对应 C++ 的 `ParamInstance`/`OliveParamInstance`。桥的语义 //! (M9 已定):节点输入值变化 → 写回 OFX 参数;OFX 参数被插件 //! 改动 → 经 oaknode 回写节点(undoable 经 -//! `oakundo::undocommand::UndoCommand`)。 +//! `oak_undo::undocommand::UndoCommand`)。 //! //! 句柄约定([`crate::suites::tag`]):`ParamDef`/`ParamInstance` //! `#[repr(C)]` 且 `props` 在偏移 0;元素装箱(`Vec>`)保证 @@ -718,7 +718,7 @@ impl ParamSetInstance { /// 插件 → 节点方向的回写入口(instanceChanged action 触发)。 /// 经 [`crate::node`] 定位绑定节点(身份注册表),再经 -/// `oakundo::undocommand::UndoCommand` 包成 undoable 修改。未绑定 +/// `oak_undo::undocommand::UndoCommand` 包成 undoable 修改。未绑定 /// 节点或身份查无时 no-op(单库化后身份注册表重建为 /// [`crate::node::register_node`]/[`crate::node::node_from_identity`]; /// facade 装配期登记,project 释放后弱条目自然失效)。 diff --git a/crates/oakplugin/src/param_curve.rs b/crates/oak-plugin/src/param_curve.rs similarity index 100% rename from crates/oakplugin/src/param_curve.rs rename to crates/oak-plugin/src/param_curve.rs diff --git a/crates/oakplugin/src/progress.rs b/crates/oak-plugin/src/progress.rs similarity index 100% rename from crates/oakplugin/src/progress.rs rename to crates/oak-plugin/src/progress.rs diff --git a/crates/oakplugin/src/property.rs b/crates/oak-plugin/src/property.rs similarity index 100% rename from crates/oakplugin/src/property.rs rename to crates/oak-plugin/src/property.rs diff --git a/crates/oakplugin/src/render.rs b/crates/oak-plugin/src/render.rs similarity index 84% rename from crates/oakplugin/src/render.rs rename to crates/oak-plugin/src/render.rs index 0cca0641b..dd3e32d9d 100644 --- a/crates/oakplugin/src/render.rs +++ b/crates/oak-plugin/src/render.rs @@ -17,20 +17,20 @@ //! oakrender 桥(single-lib unification):纹理/帧值类型与渲染调用面。 //! //! oakrender 的 C ABI 已删除(单库化):纹理是 -//! [`oakrender::texture::Texture`](value enum,无句柄),CPU 帧是 -//! [`oakrender::texture::Frame`]。本 crate 的 render 驱动与 GL suite +//! [`oak_render::texture::Texture`](value enum,无句柄),CPU 帧是 +//! [`oak_render::texture::Frame`]。本 crate 的 render 驱动与 GL suite //! 直接持值类型: //! -//! - [`Texture`] = [`oakrender::texture::Texture`](值别名; +//! - [`Texture`] = [`oak_render::texture::Texture`](值别名; //! clone 即引用语义,drop 自动释放后端 token——原 `texture_free`/ //! `frame_free` 调用面随值模型删除); -//! - [`Frame`] = [`oakrender::texture::Frame`](值别名); -//! - [`Renderer`] = `Arc` +//! - [`Frame`] = [`oak_render::texture::Frame`](值别名); +//! - [`Renderer`] = `Arc` //! (渲染器即 oakrender 后端上下文,facade 经 -//! [`oakrender::backend::GpuContext::create`] 创建); +//! [`oak_render::backend::GpuContext::create`] 创建); //! - [`VideoParams`] 直接别名 oakrender 的 -//! [`oakrender::frame::VideoParamsPod`](同布局 POD); -//! - 像素格式常量直接别名 [`oakcore_rs::PixelFormat`]。 +//! [`oak_render::frame::VideoParamsPod`](同布局 POD); +//! - 像素格式常量直接别名 [`oak_core::PixelFormat`]。 //! //! 保留桩(GPU 相关、wgpu 模型无直接 Rust 等价物): //! [`texture_id`]——oakrender 纹理(wgpu/CPU)没有 OpenGL 纹理名, @@ -42,22 +42,22 @@ /// `oakrender_video_params` POD — single-lib unification: aliases the /// oakrender crate's struct (identical layout; /// include/render/renderer.h:78). -pub type VideoParams = oakrender::frame::VideoParamsPod; +pub type VideoParams = oak_render::frame::VideoParamsPod; /// olive::PixelFormat::Format 的 f32 值。 -pub const PIXEL_FORMAT_F32: i32 = oakcore_rs::PixelFormat::F32 as i32; +pub const PIXEL_FORMAT_F32: i32 = oak_core::PixelFormat::F32 as i32; /// olive::PixelFormat::Format 的 u8 值。 -pub const PIXEL_FORMAT_U8: i32 = oakcore_rs::PixelFormat::U8 as i32; +pub const PIXEL_FORMAT_U8: i32 = oak_core::PixelFormat::U8 as i32; /// oakrender 渲染器(后端上下文;Arc 共享,GPU 纹理据此 upload/ /// download/blit——无需独立渲染器句柄)。 -pub type Renderer = std::sync::Arc; +pub type Renderer = std::sync::Arc; /// oakrender 纹理(值型;GPU 或 CPU 包装)。 -pub type Texture = oakrender::texture::Texture; +pub type Texture = oak_render::texture::Texture; /// oakrender CPU 帧(值型)。 -pub type Frame = oakrender::texture::Frame; +pub type Frame = oak_render::texture::Frame; // ---- 桥调用面(值型实现;原 CHandle 桩随单库化重写)---------------------- @@ -138,10 +138,10 @@ pub fn texture_id(_texture: &Texture) -> i32 { 0 } -/// 渲染器是否为 OpenGL 后端([`oakrender::backend::BackendKind::Gl`]; +/// 渲染器是否为 OpenGL 后端([`oak_render::backend::BackendKind::Gl`]; /// 原 `renderer_is_open_gl` 的句柄形态改为后端上下文 kind 查询)。 pub fn renderer_is_open_gl(renderer: &Renderer) -> bool { - renderer.kind() == oakrender::backend::BackendKind::Gl + renderer.kind() == oak_render::backend::BackendKind::Gl } #[cfg(test)] @@ -150,23 +150,23 @@ mod tests { /// 测试渲染器:最小 GpuContextLike 假实现(无 GPU 适配器需求)。 struct FakeGpu; - impl oakrender::backend::GpuContextLike for FakeGpu { - fn kind(&self) -> oakrender::backend::BackendKind { - oakrender::backend::BackendKind::Cpu + impl oak_render::backend::GpuContextLike for FakeGpu { + fn kind(&self) -> oak_render::backend::BackendKind { + oak_render::backend::BackendKind::Cpu } fn destroy_texture(&self, _token: u64) {} - fn upload(&self, _token: u64, _frame: &Frame) -> oakrender::error::Result<()> { + fn upload(&self, _token: u64, _frame: &Frame) -> oak_render::error::Result<()> { Ok(()) } - fn download(&self, _token: u64) -> oakrender::error::Result { + fn download(&self, _token: u64) -> oak_render::error::Result { Ok(Frame::new()) } fn blit( &self, _src: u64, _dst: u64, - _processor: Option<&oakrender::color::ColorProcessor>, - ) -> oakrender::error::Result<()> { + _processor: Option<&oak_render::color::ColorProcessor>, + ) -> oak_render::error::Result<()> { Ok(()) } } diff --git a/crates/oakplugin/src/render_driver.rs b/crates/oak-plugin/src/render_driver.rs similarity index 100% rename from crates/oakplugin/src/render_driver.rs rename to crates/oak-plugin/src/render_driver.rs diff --git a/crates/oakplugin/src/suites/draw.rs b/crates/oak-plugin/src/suites/draw.rs similarity index 100% rename from crates/oakplugin/src/suites/draw.rs rename to crates/oak-plugin/src/suites/draw.rs diff --git a/crates/oakplugin/src/suites/gl_render.rs b/crates/oak-plugin/src/suites/gl_render.rs similarity index 100% rename from crates/oakplugin/src/suites/gl_render.rs rename to crates/oak-plugin/src/suites/gl_render.rs diff --git a/crates/oakplugin/src/suites/image_effect.rs b/crates/oak-plugin/src/suites/image_effect.rs similarity index 99% rename from crates/oakplugin/src/suites/image_effect.rs rename to crates/oak-plugin/src/suites/image_effect.rs index 6f3ba88d8..56e68ea1d 100644 --- a/crates/oakplugin/src/suites/image_effect.rs +++ b/crates/oak-plugin/src/suites/image_effect.rs @@ -265,7 +265,7 @@ unsafe extern "C" fn clip_get_property_set(clip: *mut c_void, out: *mut *mut c_v /// (HS:2003-2049;`getImage` 失败 → Failed)。 /// /// `// TODO(clip)`:fetch_image 待 clip 迁移到 -/// `oakrender::texture::Texture` 值模型(当前帧访问为本地桩)。 +/// `oak_render::texture::Texture` 值模型(当前帧访问为本地桩)。 unsafe extern "C" fn clip_get_image( clip: *mut c_void, time: c_double, diff --git a/crates/oakplugin/src/suites/interact.rs b/crates/oak-plugin/src/suites/interact.rs similarity index 100% rename from crates/oakplugin/src/suites/interact.rs rename to crates/oak-plugin/src/suites/interact.rs diff --git a/crates/oakplugin/src/suites/memory.rs b/crates/oak-plugin/src/suites/memory.rs similarity index 100% rename from crates/oakplugin/src/suites/memory.rs rename to crates/oak-plugin/src/suites/memory.rs diff --git a/crates/oakplugin/src/suites/message.rs b/crates/oak-plugin/src/suites/message.rs similarity index 100% rename from crates/oakplugin/src/suites/message.rs rename to crates/oak-plugin/src/suites/message.rs diff --git a/crates/oakplugin/src/suites/mod.rs b/crates/oak-plugin/src/suites/mod.rs similarity index 96% rename from crates/oakplugin/src/suites/mod.rs rename to crates/oak-plugin/src/suites/mod.rs index 0cd619065..c855c7cca 100644 --- a/crates/oakplugin/src/suites/mod.rs +++ b/crates/oak-plugin/src/suites/mod.rs @@ -334,27 +334,27 @@ mod tests { assert!(gl_ctx().is_none()); // 最小 GpuContextLike 假实现(无 GPU 适配器需求)。 struct FakeGpu; - impl oakrender::backend::GpuContextLike for FakeGpu { - fn kind(&self) -> oakrender::backend::BackendKind { - oakrender::backend::BackendKind::Cpu + impl oak_render::backend::GpuContextLike for FakeGpu { + fn kind(&self) -> oak_render::backend::BackendKind { + oak_render::backend::BackendKind::Cpu } fn destroy_texture(&self, _token: u64) {} fn upload( &self, _token: u64, - _frame: &oakrender::texture::Frame, - ) -> oakrender::error::Result<()> { + _frame: &oak_render::texture::Frame, + ) -> oak_render::error::Result<()> { Ok(()) } - fn download(&self, _token: u64) -> oakrender::error::Result { - Ok(oakrender::texture::Frame::new()) + fn download(&self, _token: u64) -> oak_render::error::Result { + Ok(oak_render::texture::Frame::new()) } fn blit( &self, _src: u64, _dst: u64, - _processor: Option<&oakrender::color::ColorProcessor>, - ) -> oakrender::error::Result<()> { + _processor: Option<&oak_render::color::ColorProcessor>, + ) -> oak_render::error::Result<()> { Ok(()) } } @@ -369,7 +369,7 @@ mod tests { let got = gl_ctx().unwrap(); assert_eq!( got.renderer.kind(), - oakrender::backend::BackendKind::Cpu + oak_render::backend::BackendKind::Cpu ); assert!(got.output_texture.is_dummy()); assert_eq!(got.gl_pixel_depth, "OfxBitDepthFloat"); diff --git a/crates/oakplugin/src/suites/multithread.rs b/crates/oak-plugin/src/suites/multithread.rs similarity index 100% rename from crates/oakplugin/src/suites/multithread.rs rename to crates/oak-plugin/src/suites/multithread.rs diff --git a/crates/oakplugin/src/suites/param.rs b/crates/oak-plugin/src/suites/param.rs similarity index 100% rename from crates/oakplugin/src/suites/param.rs rename to crates/oak-plugin/src/suites/param.rs diff --git a/crates/oakplugin/src/suites/parametric.rs b/crates/oak-plugin/src/suites/parametric.rs similarity index 100% rename from crates/oakplugin/src/suites/parametric.rs rename to crates/oak-plugin/src/suites/parametric.rs diff --git a/crates/oakplugin/src/suites/progress.rs b/crates/oak-plugin/src/suites/progress.rs similarity index 100% rename from crates/oakplugin/src/suites/progress.rs rename to crates/oak-plugin/src/suites/progress.rs diff --git a/crates/oakplugin/src/suites/property.rs b/crates/oak-plugin/src/suites/property.rs similarity index 100% rename from crates/oakplugin/src/suites/property.rs rename to crates/oak-plugin/src/suites/property.rs diff --git a/crates/oakplugin/src/suites/timeline.rs b/crates/oak-plugin/src/suites/timeline.rs similarity index 100% rename from crates/oakplugin/src/suites/timeline.rs rename to crates/oak-plugin/src/suites/timeline.rs diff --git a/crates/oakplugin/tests/colour_test.rs b/crates/oak-plugin/tests/colour_test.rs similarity index 96% rename from crates/oakplugin/tests/colour_test.rs rename to crates/oak-plugin/tests/colour_test.rs index 84273415d..37a55ed49 100644 --- a/crates/oakplugin/tests/colour_test.rs +++ b/crates/oak-plugin/tests/colour_test.rs @@ -25,10 +25,10 @@ mod common; use std::sync::Arc; -use oakplugin::handle::RefBox; -use oakplugin::host::Host; -use oakplugin::instance::Instance; -use oakplugin::property::Value; +use oak_plugin::handle::RefBox; +use oak_plugin::host::Host; +use oak_plugin::instance::Instance; +use oak_plugin::property::Value; const TEST_PLUGIN_ID: &str = "org.oak.test-plugin"; @@ -44,7 +44,7 @@ fn scan_and_create(id: &str) -> Option>> { host.create_instance(id, None).ok() } -fn prop_str(props: &oakplugin::property::PropertySet, name: &str) -> Option { +fn prop_str(props: &oak_plugin::property::PropertySet, name: &str) -> Option { match props.get(name, 0)? { Value::String(s) => Some(s.to_string_lossy().into_owned()), _ => None, diff --git a/crates/oakplugin/tests/common/mod.rs b/crates/oak-plugin/tests/common/mod.rs similarity index 97% rename from crates/oakplugin/tests/common/mod.rs rename to crates/oak-plugin/tests/common/mod.rs index 0dadc57f8..f7d600397 100644 --- a/crates/oakplugin/tests/common/mod.rs +++ b/crates/oak-plugin/tests/common/mod.rs @@ -20,7 +20,7 @@ //! 运行时装配成 oak-test-plugin.ofx.bundle):filter 上下文、 //! Double 参数 gain、双 clip(Source/Output)。插件未构建时相关 //! 用例经 [`skip`] 提前返回。 -//! 单库化后像素路径经 oakrender 值模型(`oakrender::texture::Texture`) +//! 单库化后像素路径经 oakrender 值模型(`oak_render::texture::Texture`) //! 驱动;渲染 goldens 待该迁移落地。 use std::path::PathBuf; diff --git a/crates/oakplugin/tests/fixtures/build_fixture.sh b/crates/oak-plugin/tests/fixtures/build_fixture.sh similarity index 100% rename from crates/oakplugin/tests/fixtures/build_fixture.sh rename to crates/oak-plugin/tests/fixtures/build_fixture.sh diff --git a/crates/oakplugin/tests/fixtures/ci_test_plugin.c b/crates/oak-plugin/tests/fixtures/ci_test_plugin.c similarity index 100% rename from crates/oakplugin/tests/fixtures/ci_test_plugin.c rename to crates/oak-plugin/tests/fixtures/ci_test_plugin.c diff --git a/crates/oakplugin/tests/gl_render_test.rs b/crates/oak-plugin/tests/gl_render_test.rs similarity index 80% rename from crates/oakplugin/tests/gl_render_test.rs rename to crates/oak-plugin/tests/gl_render_test.rs index da90ec2b7..5cbc451e9 100644 --- a/crates/oakplugin/tests/gl_render_test.rs +++ b/crates/oak-plugin/tests/gl_render_test.rs @@ -16,7 +16,7 @@ //! GL 渲染桥端到端:真实 CGL 离屏上下文 + 输出纹理/FBO + 回读。 //! -//! 链路(方案 B,见 [`oakplugin::gl_bridge`] 模块文档):扫描最小测试 +//! 链路(方案 B,见 [`oak_plugin::gl_bridge`] 模块文档):扫描最小测试 //! 插件的 GL 变体(org.oak.test-plugin.gl,声明 OpenGLRenderSupported= //! "true" + F32)→ 用 GL 后端渲染器(fake `GpuContextLike`,kind=Gl) //! 构造 RenderJob → `render_frame` 的 use_opengl 决策命中 → 桥建 CGL @@ -39,11 +39,11 @@ mod common; use std::ffi::{c_char, c_int, c_void, CStr, CString}; use std::sync::Arc; -use oakcore_rs::{PixelFormat, Rational}; -use oakplugin::host::Host; -use oakplugin::render::{Renderer, Texture}; -use oakrender::backend::{BackendKind, GpuContextLike}; -use oakrender::texture::Frame; +use oak_core::{PixelFormat, Rational}; +use oak_plugin::host::Host; +use oak_plugin::render::{Renderer, Texture}; +use oak_render::backend::{BackendKind, GpuContextLike}; +use oak_render::texture::Frame; const GL_PLUGIN_ID: &str = "org.oak.test-plugin.gl"; @@ -57,18 +57,18 @@ impl GpuContextLike for FakeGlRenderer { BackendKind::Gl } fn destroy_texture(&self, _token: u64) {} - fn upload(&self, _token: u64, _frame: &Frame) -> oakrender::error::Result<()> { + fn upload(&self, _token: u64, _frame: &Frame) -> oak_render::error::Result<()> { Ok(()) } - fn download(&self, _token: u64) -> oakrender::error::Result { + fn download(&self, _token: u64) -> oak_render::error::Result { Ok(Frame::new()) } fn blit( &self, _src: u64, _dst: u64, - _processor: Option<&oakrender::color::ColorProcessor>, - ) -> oakrender::error::Result<()> { + _processor: Option<&oak_render::color::ColorProcessor>, + ) -> oak_render::error::Result<()> { Ok(()) } } @@ -116,7 +116,7 @@ fn scan_and_register() -> bool { common::skip("测试插件扫描失败"); return false; } - oakplugin::node_factory::register_plugin_nodes(); + oak_plugin::node_factory::register_plugin_nodes(); true } @@ -132,7 +132,7 @@ fn gl_plugin_renders_through_real_gl_path() { common::skip("GL 测试需 OAK_GPU_TESTS(本机 GPU 验收;CI 一律跳过)"); return; } - if !oakplugin::gl_bridge::gl_available() { + if !oak_plugin::gl_bridge::gl_available() { common::skip("本机无可用 GL 上下文"); return; } @@ -141,7 +141,7 @@ fn gl_plugin_renders_through_real_gl_path() { } let mut captured: Vec<(String, String)> = Vec::new(); - oakplugin::suites::message::set_handler( + oak_plugin::suites::message::set_handler( Some(capture_msg), &mut captured as *mut _ as *mut c_void, ); @@ -149,14 +149,14 @@ fn gl_plugin_renders_through_real_gl_path() { let inst = Host::global() .create_instance(GL_PLUGIN_ID, None) .expect("GL 变体实例应可建"); - let reg = oakplugin::node_factory::register_instance(inst.clone()); + let reg = oak_plugin::node_factory::register_instance(inst.clone()); - let dst = oakrender::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) + let dst = oak_render::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) .unwrap(); - let src = oakrender::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) + let src = oak_render::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) .unwrap(); let renderer: Renderer = Arc::new(FakeGlRenderer); - let job = oakplugin::render_driver::RenderJob { + let job = oak_plugin::render_driver::RenderJob { time: 0.0, dst: Texture::wrap_frame(dst), src: Some(Texture::wrap_frame(src)), @@ -167,11 +167,11 @@ fn gl_plugin_renders_through_real_gl_path() { clear_destination: false, interactive: false, }; - let (out, _rois) = oakplugin::render_driver::render_frame(&inst.value, &job) + let (out, _rois) = oak_plugin::render_driver::render_frame(&inst.value, &job) .expect("GL render_frame 应成功"); - oakplugin::node_factory::unregister_instance(reg); - oakplugin::suites::message::set_handler(None, std::ptr::null_mut()); + oak_plugin::node_factory::unregister_instance(reg); + oak_plugin::suites::message::set_handler(None, std::ptr::null_mut()); Host::global().shutdown(); // 1. 输出像素 = 插件 GL 清屏色(CPU 路径恒 0.5,可区分)。 @@ -219,7 +219,7 @@ fn gl_plugin_falls_back_to_cpu_without_gl_renderer() { return; } let mut captured: Vec<(String, String)> = Vec::new(); - oakplugin::suites::message::set_handler( + oak_plugin::suites::message::set_handler( Some(capture_msg), &mut captured as *mut _ as *mut c_void, ); @@ -227,13 +227,13 @@ fn gl_plugin_falls_back_to_cpu_without_gl_renderer() { let inst = Host::global() .create_instance(GL_PLUGIN_ID, None) .expect("GL 变体实例应可建"); - let reg = oakplugin::node_factory::register_instance(inst.clone()); + let reg = oak_plugin::node_factory::register_instance(inst.clone()); - let dst = oakrender::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) + let dst = oak_render::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) .unwrap(); - let src = oakrender::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) + let src = oak_render::eval::generate_frame(Rational::new(0, 1), (4, 4), PixelFormat::F32) .unwrap(); - let job = oakplugin::render_driver::RenderJob { + let job = oak_plugin::render_driver::RenderJob { time: 0.0, dst: Texture::wrap_frame(dst), src: Some(Texture::wrap_frame(src)), @@ -244,11 +244,11 @@ fn gl_plugin_falls_back_to_cpu_without_gl_renderer() { clear_destination: false, interactive: false, }; - let (out, _rois) = oakplugin::render_driver::render_frame(&inst.value, &job) + let (out, _rois) = oak_plugin::render_driver::render_frame(&inst.value, &job) .expect("CPU 回退 render_frame 应成功"); - oakplugin::node_factory::unregister_instance(reg); - oakplugin::suites::message::set_handler(None, std::ptr::null_mut()); + oak_plugin::node_factory::unregister_instance(reg); + oak_plugin::suites::message::set_handler(None, std::ptr::null_mut()); Host::global().shutdown(); let px = first_pixel(&out); diff --git a/crates/oakplugin/tests/golden_test.rs b/crates/oak-plugin/tests/golden_test.rs similarity index 100% rename from crates/oakplugin/tests/golden_test.rs rename to crates/oak-plugin/tests/golden_test.rs diff --git a/crates/oakplugin/tests/handle_test.rs b/crates/oak-plugin/tests/handle_test.rs similarity index 95% rename from crates/oakplugin/tests/handle_test.rs rename to crates/oak-plugin/tests/handle_test.rs index 7cc8518c7..0d38f50bc 100644 --- a/crates/oakplugin/tests/handle_test.rs +++ b/crates/oak-plugin/tests/handle_test.rs @@ -19,7 +19,7 @@ //! 单库化(M14 R5)后 crate 内部不再传 CHandle——原 CHandle 装拆 //! (`make_owned`/`make_borrowed`/`get`)、panic 兜底(`guard`/ //! `guard_handle`/`guard_void`)与身份注册表(`Registry`)均已删除。 -//! [`oakplugin::handle::RefBox`] 仅作为 `Host::create_instance` 的 +//! [`oak_plugin::handle::RefBox`] 仅作为 `Host::create_instance` 的 //! 边界返回类型保留(`Arc>`,oakengine test_support //! 消费);此处验证其基本契约。每个测试只验一条规则,命名即规约。 @@ -28,7 +28,7 @@ mod common; use std::sync::atomic::{AtomicU32, AtomicUsize, Ordering}; use std::sync::Arc; -use oakplugin::handle::RefBox; +use oak_plugin::handle::RefBox; /// 析构标志:以"被析构次数"断言对象的销毁时机(Arc 生命周期语义的 /// 行为探针)。 diff --git a/crates/oakplugin/tests/interact_test.rs b/crates/oak-plugin/tests/interact_test.rs similarity index 88% rename from crates/oakplugin/tests/interact_test.rs rename to crates/oak-plugin/tests/interact_test.rs index 4dca2e291..dc0d62071 100644 --- a/crates/oakplugin/tests/interact_test.rs +++ b/crates/oak-plugin/tests/interact_test.rs @@ -35,7 +35,7 @@ mod common; use std::path::PathBuf; -use oakplugin::suites::{interact::Interact, status}; +use oak_plugin::suites::{interact::Interact, status}; const INTERACT_PLUGIN_ID: &str = "org.oak.test-plugin.interact"; const BASE_PLUGIN_ID: &str = "org.oak.test-plugin"; @@ -48,11 +48,11 @@ fn scan_and_register() -> bool { common::skip("最小测试插件未构建"); return false; }; - if oakplugin::host::Host::global().cache.scan_path(&dir).is_err() { + if oak_plugin::host::Host::global().cache.scan_path(&dir).is_err() { common::skip("测试插件扫描失败"); return false; } - oakplugin::node_factory::register_plugin_nodes(); + oak_plugin::node_factory::register_plugin_nodes(); true } @@ -82,14 +82,14 @@ fn base_plugin_has_no_interact() { if !scan_and_register() { return; } - let inst = oakplugin::host::Host::global() + let inst = oak_plugin::host::Host::global() .create_instance(BASE_PLUGIN_ID, None) .expect("base 插件实例应可建"); assert!( inst.value.new_interact().is_none(), "无 interact 的插件 new_interact 应为 None" ); - oakplugin::host::Host::global().shutdown(); + oak_plugin::host::Host::global().shutdown(); }); } @@ -105,7 +105,7 @@ fn interact_lifecycle_and_events() { let _ = std::fs::remove_file(&marker); unsafe { std::env::set_var(MARKER_ENV, &marker) }; - let inst = oakplugin::host::Host::global() + let inst = oak_plugin::host::Host::global() .create_instance(INTERACT_PLUGIN_ID, None) .expect("interact 变体实例应可建"); @@ -122,10 +122,10 @@ fn interact_lifecycle_and_events() { assert_eq!(interact.pen_down((30.0, 40.0), 5.0), status::OK); assert_eq!(interact.pen_up((30.0, 40.0), 5.0), status::OK); assert_eq!( - interact.key_down(oakplugin::host::KEY_A, "a", 5.0), + interact.key_down(oak_plugin::host::KEY_A, "a", 5.0), status::OK ); - assert_eq!(interact.key_up(oakplugin::host::KEY_A, "a", 5.0), status::OK); + assert_eq!(interact.key_up(oak_plugin::host::KEY_A, "a", 5.0), status::OK); assert_eq!(interact.idle(), status::OK); interact.destroy(); @@ -177,7 +177,7 @@ fn interact_lifecycle_and_events() { "idle 未记录:{lines:?}" ); - oakplugin::host::Host::global().shutdown(); + oak_plugin::host::Host::global().shutdown(); }); } @@ -193,13 +193,13 @@ fn interact_passthrough_plugin_status() { let _ = std::fs::remove_file(&marker); unsafe { std::env::set_var(MARKER_ENV, &marker) }; - let inst = oakplugin::host::Host::global() + let inst = oak_plugin::host::Host::global() .create_instance(INTERACT_PLUGIN_ID, None) .expect("interact 变体实例应可建"); let interact = inst.value.new_interact().expect("interact 应可建"); // Escape 的 key_down:插件返回 ReplyDefault → 宿主透传。 - let st = interact.key_down(oakplugin::host::KEY_ESCAPE, "", 0.0); + let st = interact.key_down(oak_plugin::host::KEY_ESCAPE, "", 0.0); assert_eq!(st, status::REPLY_DEFAULT, "插件 Escape → ReplyDefault 应透传"); unsafe { std::env::remove_var(MARKER_ENV) }; @@ -210,7 +210,7 @@ fn interact_passthrough_plugin_status() { "Escape key_down 应真实到达插件:{lines:?}" ); - oakplugin::host::Host::global().shutdown(); + oak_plugin::host::Host::global().shutdown(); }); } @@ -226,7 +226,7 @@ fn instance_destroy_cleans_up_interact() { let _ = std::fs::remove_file(&marker); unsafe { std::env::set_var(MARKER_ENV, &marker) }; - let inst = oakplugin::host::Host::global() + let inst = oak_plugin::host::Host::global() .create_instance(INTERACT_PLUGIN_ID, None) .expect("interact 变体实例应可建"); let _interact = inst.value.new_interact().expect("interact 应可建"); @@ -242,7 +242,7 @@ fn instance_destroy_cleans_up_interact() { "实例销毁应连带 interact destroy:{lines:?}" ); - oakplugin::host::Host::global().shutdown(); + oak_plugin::host::Host::global().shutdown(); }); } @@ -263,7 +263,7 @@ fn interact_draw_renders_plugin_colours() { common::skip("GL 测试需 OAK_GPU_TESTS"); return; } - if !oakplugin::gl_bridge::gl_available() { + if !oak_plugin::gl_bridge::gl_available() { common::skip("本机无可用 GL 上下文"); return; } @@ -274,32 +274,32 @@ fn interact_draw_renders_plugin_colours() { let _ = std::fs::remove_file(&marker); unsafe { std::env::set_var(MARKER_ENV, &marker) }; - let inst = oakplugin::host::Host::global() + let inst = oak_plugin::host::Host::global() .create_instance(INTERACT_PLUGIN_ID, None) .expect("interact 变体实例应可建"); let interact = inst.value.new_interact().expect("interact 应可建"); let (w, h) = (64i32, 64i32); - let params = oakplugin::render::VideoParams { + let params = oak_plugin::render::VideoParams { width: w, height: h, - format: oakplugin::render::PIXEL_FORMAT_F32, + format: oak_plugin::render::PIXEL_FORMAT_F32, ..Default::default() }; // 一次 acquire 覆盖 FBO 装配 → draw(内部嵌套 acquire)→ 回读。 - let _guard = oakplugin::gl_bridge::acquire().expect("acquire 应成功"); - let tex = oakplugin::gl_bridge::create_output_texture(w, h, ¶ms) + let _guard = oak_plugin::gl_bridge::acquire().expect("acquire 应成功"); + let tex = oak_plugin::gl_bridge::create_output_texture(w, h, ¶ms) .expect("输出纹理应可建"); - let fbo = oakplugin::gl_bridge::create_fbo(tex, w, h).expect("FBO 应完整"); - oakplugin::gl_bridge::bind_fbo(fbo); - oakplugin::gl_bridge::set_viewport(w, h); + let fbo = oak_plugin::gl_bridge::create_fbo(tex, w, h).expect("FBO 应完整"); + oak_plugin::gl_bridge::bind_fbo(fbo); + oak_plugin::gl_bridge::set_viewport(w, h); let st = interact.draw((64.0, 64.0), (1.0, 1.0), 5.0, None); assert_eq!(st, status::OK, "draw 应返回插件 OK"); - let img = oakplugin::gl_bridge::read_pixels_to_image(w, h, ¶ms).expect("回读应成功"); - oakplugin::gl_bridge::delete_fbo(fbo); - oakplugin::gl_bridge::delete_gl_texture(tex); + let img = oak_plugin::gl_bridge::read_pixels_to_image(w, h, ¶ms).expect("回读应成功"); + oak_plugin::gl_bridge::delete_fbo(fbo); + oak_plugin::gl_bridge::delete_gl_texture(tex); drop(_guard); unsafe { std::env::remove_var(MARKER_ENV) }; @@ -369,6 +369,6 @@ fn interact_draw_renders_plugin_colours() { ); assert_eq!(rect_n + clear_n, (w * h) as usize, "整帧应为背景+矩形两色"); - oakplugin::host::Host::global().shutdown(); + oak_plugin::host::Host::global().shutdown(); }); } diff --git a/crates/oakplugin/tests/negotiation_test.rs b/crates/oak-plugin/tests/negotiation_test.rs similarity index 95% rename from crates/oakplugin/tests/negotiation_test.rs rename to crates/oak-plugin/tests/negotiation_test.rs index e246bc783..087b5bb58 100644 --- a/crates/oakplugin/tests/negotiation_test.rs +++ b/crates/oak-plugin/tests/negotiation_test.rs @@ -29,9 +29,9 @@ mod common; use std::sync::Arc; -use oakplugin::handle::RefBox; -use oakplugin::host::Host; -use oakplugin::instance::Instance; +use oak_plugin::handle::RefBox; +use oak_plugin::host::Host; +use oak_plugin::instance::Instance; const TEST_PLUGIN_ID: &str = "org.oak.test-plugin"; @@ -108,7 +108,7 @@ fn region_of_definition_default_and_override() { }; let rod = inst .value - .get_region_of_definition(0.0, oakplugin::instance::RenderScale { x: 1.0, y: 1.0 }) + .get_region_of_definition(0.0, oak_plugin::instance::RenderScale { x: 1.0, y: 1.0 }) .expect("getRoD 应成功"); assert_eq!((rod.x1, rod.y1, rod.x2, rod.y2), (0.0, 0.0, 1920.0, 1080.0)); Host::global().shutdown(); @@ -125,7 +125,7 @@ fn regions_of_interest_writeback() { Host::global().shutdown(); return; }; - let region = oakplugin::instance::OfxRectD { + let region = oak_plugin::instance::OfxRectD { x1: 10.0, y1: 20.0, x2: 100.0, @@ -135,7 +135,7 @@ fn regions_of_interest_writeback() { .value .get_regions_of_interest( 0.0, - oakplugin::instance::RenderScale { x: 1.0, y: 1.0 }, + oak_plugin::instance::RenderScale { x: 1.0, y: 1.0 }, region, ) .expect("getRoI 应成功"); @@ -194,7 +194,7 @@ fn field_passthrough() { #[test] fn sequence_render_brackets() { common::with_host(|| { - use oakplugin::instance::OfxRangeD; + use oak_plugin::instance::OfxRangeD; let Some(inst) = create_instance() else { Host::global().shutdown(); return; diff --git a/crates/oakplugin/tests/node_e2e_test.rs b/crates/oak-plugin/tests/node_e2e_test.rs similarity index 81% rename from crates/oakplugin/tests/node_e2e_test.rs rename to crates/oak-plugin/tests/node_e2e_test.rs index 3e147e4f2..6288f6631 100644 --- a/crates/oakplugin/tests/node_e2e_test.rs +++ b/crates/oak-plugin/tests/node_e2e_test.rs @@ -27,14 +27,14 @@ mod common; -use oakcore_rs::{PixelFormat, Rational}; -use oaknode::factory::Factory; -use oaknode::graph::Graph; -use oaknode::node::{NodeBehavior, NodeCore}; -use oaknode::traverser::{EvalRequest, Traverser}; -use oaknode::value::{NodeValue, ValueType}; -use oakplugin::host::Host; -use oakrender::texture::Texture; +use oak_core::{PixelFormat, Rational}; +use oak_node::factory::Factory; +use oak_node::graph::Graph; +use oak_node::node::{NodeBehavior, NodeCore}; +use oak_node::traverser::{EvalRequest, Traverser}; +use oak_node::value::{NodeValue, ValueType}; +use oak_plugin::host::Host; +use oak_render::texture::Texture; const PLUGIN_ID: &str = "org.oak.test-plugin"; const IDENTITY_ID: &str = "org.oak.test-plugin.identity"; @@ -64,12 +64,12 @@ impl NodeBehavior for ConstSource { fn value( &self, _core: &NodeCore, - _inputs: &oaknode::value::NodeValueRow, + _inputs: &oak_node::value::NodeValueRow, time: Rational, - table: &mut oaknode::value::NodeValueTable, + table: &mut oak_node::value::NodeValueTable, ) { let mut frame = - oakrender::eval::generate_frame(time, self.size, PixelFormat::F32).unwrap(); + oak_render::eval::generate_frame(time, self.size, PixelFormat::F32).unwrap(); for pixel in frame.data.chunks_exact_mut(16) { for (i, v) in self.rgba.iter().enumerate() { pixel[i * 4..i * 4 + 4].copy_from_slice(&v.to_le_bytes()); @@ -77,7 +77,7 @@ impl NodeBehavior for ConstSource { } table.push( ValueType::Texture, - NodeValue::Texture(oaknode::handle::make_owned(Texture::wrap_frame(frame))), + NodeValue::Texture(oak_node::handle::make_owned(Texture::wrap_frame(frame))), None, ); } @@ -93,13 +93,13 @@ fn scan_and_register() -> bool { common::skip("测试插件扫描失败"); return false; } - oakplugin::node_factory::register_plugin_nodes(); + oak_plugin::node_factory::register_plugin_nodes(); true } /// 取输出表的渲染纹理(resolve 后的真纹理盒)。 fn rendered_texture( - table: &oaknode::value::NodeValueTable, + table: &oak_node::value::NodeValueTable, ) -> Texture { let NodeValue::Texture(handle) = table .get(ValueType::Texture) @@ -107,7 +107,7 @@ fn rendered_texture( else { panic!("纹理槽不是 Texture 值"); }; - unsafe { oaknode::handle::get_checked::(handle) } + unsafe { oak_node::handle::get_checked::(handle) } .cloned() .expect("纹理盒必须是渲染产物(PluginJobPayload 已 resolve)") } @@ -145,7 +145,7 @@ fn plugin_nodes_register_with_translated_inputs() { assert_eq!(meta.sub_category, "Filter"); assert_eq!( meta.categories, - vec![oaknode::node::Category::OpenFx] + vec![oak_node::node::Category::OpenFx] ); let (core, behavior) = Factory::global() @@ -182,7 +182,7 @@ fn plugin_nodes_register_with_translated_inputs() { // debug:secret → hidden。 let debug = core.get_input("debug").expect("debug 输入"); assert!( - debug.flags & oaknode::input::flags::HIDDEN != 0, + debug.flags & oak_node::input::flags::HIDDEN != 0, "secret 参数应隐藏" ); @@ -198,7 +198,7 @@ fn plugin_nodes_register_with_translated_inputs() { // 行为是持真实实例句柄的 PluginNode。 let plugin = behavior .as_any() - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .expect("行为应是 PluginNode"); assert!(!plugin.instance_handle().is_null()); @@ -232,7 +232,7 @@ fn plugin_renders_constant_frame_end_to_end() { .expect("Source 连接"); let mut traverser = Traverser::new(); - let mut hooks = oakrender::eval::RenderEvalHooks::new(); + let mut hooks = oak_render::eval::RenderEvalHooks::new(); let table = traverser .evaluate( &graph, @@ -276,7 +276,7 @@ fn identity_variant_passes_source_through() { .expect("Source 连接"); let mut traverser = Traverser::new(); - let mut hooks = oakrender::eval::RenderEvalHooks::new(); + let mut hooks = oak_render::eval::RenderEvalHooks::new(); let table = traverser .evaluate( &graph, @@ -303,24 +303,24 @@ fn param_overrides_reach_instance() { let inst = Host::global() .create_instance(PLUGIN_ID, None) .expect("实例"); - let id = oakplugin::node_factory::register_instance(inst.clone()); + let id = oak_plugin::node_factory::register_instance(inst.clone()); // 数值覆盖(gain = 1.25)。 let job_values = vec![( "gain".to_string(), - oaknode::value::NodeValue::Float(1.25), + oak_node::value::NodeValue::Float(1.25), )]; - let pod: Vec<(String, oakplugin::node::Value)> = job_values + let pod: Vec<(String, oak_plugin::node::Value)> = job_values .iter() .filter_map(|(k, v)| { - oakplugin::node::Value::from_node_value(v).map(|p| (k.clone(), p)) + oak_plugin::node::Value::from_node_value(v).map(|p| (k.clone(), p)) }) .collect(); - let dst = oakrender::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) + let dst = oak_render::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) .unwrap(); - let src = oakrender::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) + let src = oak_render::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) .unwrap(); - let job = oakplugin::render_driver::RenderJob { + let job = oak_plugin::render_driver::RenderJob { time: 0.0, dst: Texture::wrap_frame(dst), src: Some(Texture::wrap_frame(src)), @@ -331,24 +331,24 @@ fn param_overrides_reach_instance() { clear_destination: false, interactive: false, }; - oakplugin::render_driver::render_frame(&inst.value, &job) + oak_plugin::render_driver::render_frame(&inst.value, &job) .expect("render_frame 应成功"); let gain = inst.value.params.find("gain").unwrap().get(); assert_eq!( gain, - oakplugin::param::ParamValue::Double([1.25, 0.0, 0.0], 1) + oak_plugin::param::ParamValue::Double([1.25, 0.0, 0.0], 1) ); // NaN 覆盖回退默认(gain 默认 0.0)。 let pod_nan = vec![( "gain".to_string(), - oakplugin::node::Value::float(f64::NAN), + oak_plugin::node::Value::float(f64::NAN), )]; - let dst = oakrender::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) + let dst = oak_render::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) .unwrap(); - let src = oakrender::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) + let src = oak_render::eval::generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32) .unwrap(); - let job = oakplugin::render_driver::RenderJob { + let job = oak_plugin::render_driver::RenderJob { time: 0.0, dst: Texture::wrap_frame(dst), src: Some(Texture::wrap_frame(src)), @@ -359,14 +359,14 @@ fn param_overrides_reach_instance() { clear_destination: false, interactive: false, }; - oakplugin::render_driver::render_frame(&inst.value, &job) + oak_plugin::render_driver::render_frame(&inst.value, &job) .expect("NaN 覆盖不应失败"); assert_eq!( inst.value.params.find("gain").unwrap().get(), - oakplugin::param::ParamValue::Double([0.0, 0.0, 0.0], 1) + oak_plugin::param::ParamValue::Double([0.0, 0.0, 0.0], 1) ); - oakplugin::node_factory::unregister_instance(id); + oak_plugin::node_factory::unregister_instance(id); Host::global().shutdown(); }); } diff --git a/crates/oakplugin/tests/ofx_roundtrip.rs b/crates/oak-plugin/tests/ofx_roundtrip.rs similarity index 88% rename from crates/oakplugin/tests/ofx_roundtrip.rs rename to crates/oak-plugin/tests/ofx_roundtrip.rs index ded2c1167..0216ae623 100644 --- a/crates/oakplugin/tests/ofx_roundtrip.rs +++ b/crates/oak-plugin/tests/ofx_roundtrip.rs @@ -24,7 +24,7 @@ //! test skips silently when the variable is unset so plain `cargo test` //! runs stay hermetic. The CI workflow builds the fixture and sets it. -use oakplugin::host::Host; +use oak_plugin::host::Host; /// The fixture plugin's type id (tests/fixtures/ci_test_plugin.c). const FIXTURE_TYPE_ID: &str = "rs.oak.CiTestPlugin"; @@ -39,17 +39,17 @@ fn plugin_node_survives_save_load_roundtrip() { host.cache .scan_path(std::path::Path::new(&fixture_dir)) .expect("fixture dir scans"); - let registered = oakplugin::node_factory::register_plugin_nodes(); + let registered = oak_plugin::node_factory::register_plugin_nodes(); assert!( registered.iter().any(|id| id == FIXTURE_TYPE_ID), "the fixture plugin registered (got {registered:?})" ); // Build a project carrying one plugin node. - let project = oaknode::project::Project::new(); + let project = oak_node::project::Project::new(); let node_id = { let mut p = project.lock().unwrap_or_else(|e| e.into_inner()); - let (core, behavior) = oaknode::factory::Factory::global() + let (core, behavior) = oak_node::factory::Factory::global() .create_any(FIXTURE_TYPE_ID) .expect("the fixture type resolves through the factory"); p.graph.add_node(core, behavior) @@ -59,9 +59,9 @@ fn plugin_node_survives_save_load_roundtrip() { // that used to fail with "unknown node type" for plugin nodes). let xml = { let p = project.lock().unwrap_or_else(|e| e.into_inner()); - oaknode::serializer::save(&p).expect("project saves") + oak_node::serializer::save(&p).expect("project saves") }; - let loaded = oaknode::serializer::load(&xml).expect("project with a plugin node loads"); + let loaded = oak_node::serializer::load(&xml).expect("project with a plugin node loads"); let p = loaded.lock().unwrap_or_else(|e| e.into_inner()); let mut found = false; for id in p.graph.node_ids() { diff --git a/crates/oakplugin/tests/property_test.rs b/crates/oak-plugin/tests/property_test.rs similarity index 98% rename from crates/oakplugin/tests/property_test.rs rename to crates/oak-plugin/tests/property_test.rs index 3eae261d8..1b4d997f1 100644 --- a/crates/oakplugin/tests/property_test.rs +++ b/crates/oak-plugin/tests/property_test.rs @@ -23,8 +23,8 @@ mod common; use std::ffi::{c_void, CString}; use std::sync::Arc; -use oakplugin::error::Error; -use oakplugin::property::{PropertySet, Value}; +use oak_plugin::error::Error; +use oak_plugin::property::{PropertySet, Value}; /// `Value` 未实现 PartialEq(Pointer 无法比较),测试用 Debug 串 /// 比较做值相等断言(同进程内指针的 Debug 输出确定)。 diff --git a/crates/oakplugin/tests/push_button_test.rs b/crates/oak-plugin/tests/push_button_test.rs similarity index 82% rename from crates/oakplugin/tests/push_button_test.rs rename to crates/oak-plugin/tests/push_button_test.rs index 69fef3205..88760a4f3 100644 --- a/crates/oakplugin/tests/push_button_test.rs +++ b/crates/oak-plugin/tests/push_button_test.rs @@ -27,7 +27,7 @@ mod common; -use oakplugin::host::Host; +use oak_plugin::host::Host; const PLUGIN_ID: &str = "org.oak.test-plugin"; @@ -45,7 +45,7 @@ fn push_button_press_routes_instance_changed() { let inst = Host::global() .create_instance(PLUGIN_ID, None) .expect("实例"); - let id = oakplugin::node_factory::register_instance(inst.clone()); + let id = oak_plugin::node_factory::register_instance(inst.clone()); // The C plugin appends one line per instanceChanged("button") to the // marker file; the assertion reads it back. @@ -55,16 +55,16 @@ fn push_button_press_routes_instance_changed() { // The button param exists and is a push button. let p = inst.value.params.find("button").expect("button 参数"); - assert_eq!(p.def.ofx_type, oakplugin::param::TYPE_PUSHBUTTON); + assert_eq!(p.def.ofx_type, oak_plugin::param::TYPE_PUSHBUTTON); // First press: set + routed to the plugin. - assert!(oakplugin::node_factory::push_button_clicked(id, "button")); + assert!(oak_plugin::node_factory::push_button_clicked(id, "button")); // Unknown / non-button params are rejected without touching the entry. - assert!(!oakplugin::node_factory::push_button_clicked(id, "gain")); - assert!(!oakplugin::node_factory::push_button_clicked(id, "nope")); - assert!(!oakplugin::node_factory::push_button_clicked(u64::MAX, "button")); + assert!(!oak_plugin::node_factory::push_button_clicked(id, "gain")); + assert!(!oak_plugin::node_factory::push_button_clicked(id, "nope")); + assert!(!oak_plugin::node_factory::push_button_clicked(u64::MAX, "button")); // Second press on the real button: routed again. - assert!(oakplugin::node_factory::push_button_clicked(id, "button")); + assert!(oak_plugin::node_factory::push_button_clicked(id, "button")); // Exactly the two real presses reached the plugin's instanceChanged. let log = std::fs::read_to_string(&marker).expect("marker 文件应存在"); @@ -73,7 +73,7 @@ fn push_button_press_routes_instance_changed() { std::env::remove_var("OAK_TEST_PLUGIN_INSTANCECHANGED_MARKER"); let _ = std::fs::remove_file(&marker); - oakplugin::node_factory::unregister_instance(id); + oak_plugin::node_factory::unregister_instance(id); Host::global().shutdown(); }); } diff --git a/crates/oakplugin/tests/suites_test.rs b/crates/oak-plugin/tests/suites_test.rs similarity index 93% rename from crates/oakplugin/tests/suites_test.rs rename to crates/oak-plugin/tests/suites_test.rs index c94c51fd3..614c50312 100644 --- a/crates/oakplugin/tests/suites_test.rs +++ b/crates/oak-plugin/tests/suites_test.rs @@ -27,20 +27,20 @@ mod common; use std::ffi::{c_char, c_double, c_int, c_uint, c_void, CStr, CString}; use std::sync::atomic::{AtomicUsize, Ordering}; -use oakplugin::descriptor::EffectDescriptor; -use oakplugin::instance::Instance; -use oakplugin::param::{ParamInstance, ParamSetInstance}; -use oakplugin::property::{PropertySet, Value}; -use oakplugin::suites::fetch_suite; -use oakplugin::suites::image_effect::suite_v1 as image_effect_suite; -use oakplugin::suites::memory::suite_v1 as memory_suite; -use oakplugin::suites::message::suite_v1 as message_suite_v1; -use oakplugin::suites::multithread::suite_v1 as multithread_suite; -use oakplugin::suites::param::suite_v1 as param_suite; -use oakplugin::suites::progress::suite_v1 as progress_suite; -use oakplugin::suites::property::suite_v1 as property_suite; -use oakplugin::suites::tag; -use oakplugin::suites::timeline::suite_v1 as timeline_suite; +use oak_plugin::descriptor::EffectDescriptor; +use oak_plugin::instance::Instance; +use oak_plugin::param::{ParamInstance, ParamSetInstance}; +use oak_plugin::property::{PropertySet, Value}; +use oak_plugin::suites::fetch_suite; +use oak_plugin::suites::image_effect::suite_v1 as image_effect_suite; +use oak_plugin::suites::memory::suite_v1 as memory_suite; +use oak_plugin::suites::message::suite_v1 as message_suite_v1; +use oak_plugin::suites::multithread::suite_v1 as multithread_suite; +use oak_plugin::suites::param::suite_v1 as param_suite; +use oak_plugin::suites::progress::suite_v1 as progress_suite; +use oak_plugin::suites::property::suite_v1 as property_suite; +use oak_plugin::suites::tag; +use oak_plugin::suites::timeline::suite_v1 as timeline_suite; /// OFX 状态码的本地别名(SDK ofxCore.h)。 const OK: c_int = 0; @@ -59,7 +59,7 @@ fn props_handle(s: &PropertySet) -> *mut c_void { } /// 假插件(仅喂给 Instance;describe 之外的字段不被触碰)。 -fn dummy_plugin(descriptor: EffectDescriptor) -> std::sync::Arc { +fn dummy_plugin(descriptor: EffectDescriptor) -> std::sync::Arc { unsafe extern "C" fn dummy_entry( _: *const c_char, _: *const c_void, @@ -68,7 +68,7 @@ fn dummy_plugin(descriptor: EffectDescriptor) -> std::sync::Arc c_int { OK } - std::sync::Arc::new(oakplugin::host::Plugin { + std::sync::Arc::new(oak_plugin::host::Plugin { identifier: "test.plugin".into(), version: (1, 0), bundle_path: std::path::PathBuf::new(), @@ -123,7 +123,7 @@ fn make_instance() -> (std::sync::Arc, *mut c_void) { sequence_range: std::sync::Mutex::new(None), progress_cb: std::sync::Mutex::new(None), cancel: std::sync::atomic::AtomicBool::new(false), - edit: std::sync::Mutex::new(oakplugin::instance::EditTransaction::new()), + edit: std::sync::Mutex::new(oak_plugin::instance::EditTransaction::new()), render_lock: std::sync::Mutex::new(()), interact: std::sync::Mutex::new(None), }); @@ -250,7 +250,7 @@ fn memory_suite_ledger() { /// 属性读写;实例期 clipGetHandle。 /// /// clipGetImage/clipReleaseImage 配对依赖 -/// [`oakplugin::clip::ClipInstance::fetch_image`](bridge::render 帧 +/// [`oak_plugin::clip::ClipInstance::fetch_image`](bridge::render 帧 /// 访问 C ABI 未冻结)——随最小测试插件落地补全(`// TODO(plugin)`)。 #[test] fn image_effect_clip_image_pairing() { @@ -292,7 +292,7 @@ fn image_effect_clip_image_pairing() { } // 实例期 clipGetHandle(手工构造实例 + clip 实例)。 - let clip_desc = oakplugin::descriptor::ClipDescriptor { + let clip_desc = oak_plugin::descriptor::ClipDescriptor { props: PropertySet::new(), name: "Source".into(), }; @@ -301,7 +301,7 @@ fn image_effect_clip_image_pairing() { plugin: dummy_plugin(EffectDescriptor::new()), context: "OfxImageEffectContextFilter".into(), params: ParamSetInstance { params: vec![] }, - clips: vec![Box::new(oakplugin::clip::ClipInstance::from_descriptor( + clips: vec![Box::new(oak_plugin::clip::ClipInstance::from_descriptor( &clip_desc, ))], node_identity: std::sync::atomic::AtomicUsize::new(0), @@ -309,7 +309,7 @@ fn image_effect_clip_image_pairing() { sequence_range: std::sync::Mutex::new(None), progress_cb: std::sync::Mutex::new(None), cancel: std::sync::atomic::AtomicBool::new(false), - edit: std::sync::Mutex::new(oakplugin::instance::EditTransaction::new()), + edit: std::sync::Mutex::new(oak_plugin::instance::EditTransaction::new()), render_lock: std::sync::Mutex::new(()), interact: std::sync::Mutex::new(None), }); @@ -346,7 +346,7 @@ fn image_effect_clip_image_pairing() { /// setValue/getValue round-trip;AtTime == 当前值。 /// /// 声明原含"paramSetValue 触发 instanceChanged":通知走 -/// [`oakplugin::param::notify_instance_changed`](bridge 期实现)—— +/// [`oak_plugin::param::notify_instance_changed`](bridge 期实现)—— /// 随插件+桥落地补全(`// TODO(bridge)`)。 #[test] fn param_suite_roundtrip_and_change_action() { @@ -508,7 +508,7 @@ fn param_keyframe_family() { /// (`// TODO(plugin)`)。 #[test] fn message_suite_v1_v2() { - use oakplugin::suites::message::set_handler; + use oak_plugin::suites::message::set_handler; unsafe extern "C" fn capture( type_: *const c_char, @@ -602,8 +602,8 @@ fn message_suite_v1_v2() { /// 回调返回 false 时 update 向插件返回取消状态。 #[test] fn progress_suite_forwarding() { - use oakplugin::progress::ProgressReporter; - use oakplugin::suites::progress::set_current; + use oak_plugin::progress::ProgressReporter; + use oak_plugin::suites::progress::set_current; unsafe extern "C" fn capture_progress(p: f64, userdata: *mut c_void) -> c_int { let v = unsafe { &mut *(userdata as *mut Vec) }; @@ -642,8 +642,8 @@ fn progress_suite_forwarding() { /// 无上下文 → 0 / (0,0) 的 headless 默认。 #[test] fn timeline_suite_values() { - use oakplugin::instance::{OfxRangeD, RenderScale}; - use oakplugin::suites::{set_render_ctx, RenderCtx}; + use oak_plugin::instance::{OfxRangeD, RenderScale}; + use oak_plugin::suites::{set_render_ctx, RenderCtx}; let s = timeline_suite(); let handle = 0x10usize as *mut c_void; diff --git a/crates/oakrender/COVERAGE.md b/crates/oak-render/COVERAGE.md similarity index 100% rename from crates/oakrender/COVERAGE.md rename to crates/oak-render/COVERAGE.md diff --git a/crates/oakrender/Cargo.lock b/crates/oak-render/Cargo.lock similarity index 100% rename from crates/oakrender/Cargo.lock rename to crates/oak-render/Cargo.lock diff --git a/crates/oakrender/Cargo.toml b/crates/oak-render/Cargo.toml similarity index 85% rename from crates/oakrender/Cargo.toml rename to crates/oak-render/Cargo.toml index 7bf93b581..e6dd74da5 100644 --- a/crates/oakrender/Cargo.toml +++ b/crates/oak-render/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakrender" -version = "0.1.0" +name = "oak-render" +version.workspace = true edition = "2021" description = "Oak Video Editor render engine (Rust)" license = "GPL-3.0-or-later" @@ -9,13 +9,13 @@ license = "GPL-3.0-or-later" crate-type = ["staticlib", "rlib"] [dependencies] -oakcore-rs = { path = "../oakcore" } -oakcommon = { path = "../oakcommon" } +oak-core = { path = "../oak-core" } +oak-common = { path = "../oak-common" } # Direct Rust calls (single-lib unification): the decode bridge calls # oakcodec's ffi, the node bridge calls oaknode's ffi. Both directions -# are acyclic (oakcodec → oakcore-rs/oakffmpeg-link; oaknode → oakcodec). -oakcodec = { path = "../oakcodec" } -oaknode = { path = "../oaknode" } +# are acyclic (oakcodec → oakcore-rs/oak-ffmpeg-link; oaknode → oakcodec). +oak-codec = { path = "../oak-codec" } +oak-node = { path = "../oak-node" } # wgpu: portable GPU backend (Metal/Vulkan/GL/DX12 in one safe API) — the # direct replacement for the C++ liboakgl2/liboakvulkan backend plugins. # Version 25 (2025 stable line); the only GPU dependency. diff --git a/crates/oakrender/README.md b/crates/oak-render/README.md similarity index 100% rename from crates/oakrender/README.md rename to crates/oak-render/README.md diff --git a/crates/oakrender/build.rs b/crates/oak-render/build.rs similarity index 100% rename from crates/oakrender/build.rs rename to crates/oak-render/build.rs diff --git a/crates/oakrender/examples/bench_playback.rs b/crates/oak-render/examples/bench_playback.rs similarity index 94% rename from crates/oakrender/examples/bench_playback.rs rename to crates/oak-render/examples/bench_playback.rs index 6b3a898b4..0b998fb09 100644 --- a/crates/oakrender/examples/bench_playback.rs +++ b/crates/oak-render/examples/bench_playback.rs @@ -35,11 +35,11 @@ use std::path::PathBuf; use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; -use oakcore_rs::Rational; -use oakrender::ipc::SLOT_FORMAT_BGRA8; -use oakrender::procpool::{DispatcherConfig, ProcessDispatcher}; -use oakrender::ticket::{TicketPayload, TicketResult, VideoTicketParams}; -use oakrender::worker::{Job, JobDispatch, JobSchedule}; +use oak_core::Rational; +use oak_render::ipc::SLOT_FORMAT_BGRA8; +use oak_render::procpool::{DispatcherConfig, ProcessDispatcher}; +use oak_render::ticket::{TicketPayload, TicketResult, VideoTicketParams}; +use oak_render::worker::{Job, JobDispatch, JobSchedule}; /// Locate the oak-worker binary (see bench_process). fn worker_bin() -> PathBuf { @@ -119,7 +119,7 @@ fn main() { }), audio: None, produce: Arc::new(|_, _| { - Err(oakrender::error::Error::Failed( + Err(oak_render::error::Error::Failed( "process backend does not use the in-process producer".into(), )) }), @@ -201,7 +201,7 @@ fn main() { } report( "main-heap frame copies", - oakrender::procpool::main_heap_frame_copies().to_string(), + oak_render::procpool::main_heap_frame_copies().to_string(), ); dispatcher.shutdown(); diff --git a/crates/oakrender/examples/bench_process.rs b/crates/oak-render/examples/bench_process.rs similarity index 93% rename from crates/oakrender/examples/bench_process.rs rename to crates/oak-render/examples/bench_process.rs index 8a9f79944..7986fe42d 100644 --- a/crates/oakrender/examples/bench_process.rs +++ b/crates/oak-render/examples/bench_process.rs @@ -32,7 +32,7 @@ //! ``` //! //! `frames` defaults to 240, `workers` to the adaptive -//! [`oakrender::procpool::default_worker_count`] policy. The oak-worker +//! [`oak_render::procpool::default_worker_count`] policy. The oak-worker //! binary is located next to the build output (`target//oak-worker`), //! or via `$OAK_WORKER_BIN`. @@ -40,11 +40,11 @@ use std::path::PathBuf; use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; -use oakcore_rs::Rational; -use oakrender::ipc::SLOT_FORMAT_BGRA8; -use oakrender::procpool::{DispatcherConfig, ProcessDispatcher}; -use oakrender::ticket::{TicketPayload, TicketResult, VideoTicketParams}; -use oakrender::worker::{Job, JobDispatch, JobSchedule}; +use oak_core::Rational; +use oak_render::ipc::SLOT_FORMAT_BGRA8; +use oak_render::procpool::{DispatcherConfig, ProcessDispatcher}; +use oak_render::ticket::{TicketPayload, TicketResult, VideoTicketParams}; +use oak_render::worker::{Job, JobDispatch, JobSchedule}; /// Locate the oak-worker binary: `$OAK_WORKER_BIN`, else the sibling of /// the current executable's `examples/` directory, else `oak-worker` on @@ -122,7 +122,7 @@ fn main() { // Never invoked on the process backend (workers render from the // wire spec); must still be a valid producer. produce: Arc::new(|_, _| { - Err(oakrender::error::Error::Failed( + Err(oak_render::error::Error::Failed( "process backend does not use the in-process producer".into(), )) }), @@ -204,7 +204,7 @@ fn main() { } else { report("adjacent-frame delta", "no adjacent pairs completed".to_string()); } - report("main-heap frame copies", oakrender::procpool::main_heap_frame_copies().to_string()); + report("main-heap frame copies", oak_render::procpool::main_heap_frame_copies().to_string()); dispatcher.shutdown(); } diff --git a/crates/oakrender/src/autocacher.rs b/crates/oak-render/src/autocacher.rs similarity index 99% rename from crates/oakrender/src/autocacher.rs rename to crates/oak-render/src/autocacher.rs index 7a70f283b..85ab2eb56 100644 --- a/crates/oakrender/src/autocacher.rs +++ b/crates/oak-render/src/autocacher.rs @@ -28,7 +28,7 @@ use std::collections::HashSet; use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; use crate::error::Result; use crate::ticket::{TicketArena, TicketId, VideoTicketParams}; diff --git a/crates/oakrender/src/backend.rs b/crates/oak-render/src/backend.rs similarity index 99% rename from crates/oakrender/src/backend.rs rename to crates/oak-render/src/backend.rs index 4ea4e9f33..419a5e5fc 100644 --- a/crates/oakrender/src/backend.rs +++ b/crates/oak-render/src/backend.rs @@ -35,7 +35,7 @@ use std::collections::HashMap; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::PixelFormat; +use oak_core::PixelFormat; use crate::error::{Error, Result}; use crate::frame::VideoParamsPod; diff --git a/crates/oakrender/src/cache.rs b/crates/oak-render/src/cache.rs similarity index 99% rename from crates/oakrender/src/cache.rs rename to crates/oak-render/src/cache.rs index 272332e7c..c8debfefb 100644 --- a/crates/oakrender/src/cache.rs +++ b/crates/oak-render/src/cache.rs @@ -31,7 +31,7 @@ use std::io::Write; use std::sync::atomic::{AtomicU64, Ordering}; use std::sync::{LazyLock, Mutex}; -use oakcore_rs::{Rational, TimeRange, TimeRangeList}; +use oak_core::{Rational, TimeRange, TimeRangeList}; use crate::error::{Error, Result}; diff --git a/crates/oakrender/src/cancelatom.rs b/crates/oak-render/src/cancelatom.rs similarity index 96% rename from crates/oakrender/src/cancelatom.rs rename to crates/oak-render/src/cancelatom.rs index 388b6cd50..e29e726c6 100644 --- a/crates/oakrender/src/cancelatom.rs +++ b/crates/oak-render/src/cancelatom.rs @@ -23,4 +23,4 @@ //! consumers, e.g. oakcodec) keep working unchanged. /// Shared cancellation atom (oakcommon). -pub use oakcommon::cancelatom::CancelAtom; +pub use oak_common::cancelatom::CancelAtom; diff --git a/crates/oakrender/src/color.rs b/crates/oak-render/src/color.rs similarity index 99% rename from crates/oakrender/src/color.rs rename to crates/oak-render/src/color.rs index 4613bd4e2..2042dd700 100644 --- a/crates/oakrender/src/color.rs +++ b/crates/oak-render/src/color.rs @@ -23,7 +23,7 @@ use std::sync::{LazyLock, Mutex}; -use oakcore_rs::PixelFormat; +use oak_core::PixelFormat; use crate::error::{Error, Result}; use crate::texture::Frame; diff --git a/crates/oakrender/src/commonutil.rs b/crates/oak-render/src/commonutil.rs similarity index 92% rename from crates/oakrender/src/commonutil.rs rename to crates/oak-render/src/commonutil.rs index 1398db051..ec0fa2687 100644 --- a/crates/oakrender/src/commonutil.rs +++ b/crates/oak-render/src/commonutil.rs @@ -24,7 +24,7 @@ use std::sync::Mutex; /// Read a config string via the domain store /// (`ConfigStore::get(group, key)`); `None` when missing or empty. pub fn config_get_string(group: Option<&str>, key: &str) -> Option { - oakcommon::configstore::ConfigStore::instance() + oak_common::configstore::ConfigStore::instance() .get(group, key) .ok() .filter(|s| !s.is_empty()) @@ -32,14 +32,14 @@ pub fn config_get_string(group: Option<&str>, key: &str) -> Option { /// `oakcommon_config_get_int(group, key, default)`. pub fn config_get_int(group: Option<&str>, key: &str, default: i32) -> i32 { - oakcommon::configstore::ConfigStore::instance().get_int(group, key, default) + oak_common::configstore::ConfigStore::instance().get_int(group, key, default) } /// The configuration directory — oakcommon's implementation /// (`FileFunctions::get_configuration_location`, honoring `OAK_CONFIG_DIR` /// and the platform fallbacks). pub fn configuration_location() -> String { - oakcommon::filefunctions::FileFunctions::new() + oak_common::filefunctions::FileFunctions::new() .get_configuration_location() .unwrap_or_default() } @@ -51,7 +51,7 @@ pub static ENV_TEST_LOCK: Mutex<()> = Mutex::new(()); /// The default disk cache directory (C++ `DiskManager:: /// get_default_disk_cache_path`): `/mediacache`. pub fn default_disk_cache_path() -> String { - oakcommon::filefunctions::default_disk_cache_path() + oak_common::filefunctions::default_disk_cache_path() } #[cfg(test)] diff --git a/crates/oakrender/src/copier.rs b/crates/oak-render/src/copier.rs similarity index 100% rename from crates/oakrender/src/copier.rs rename to crates/oak-render/src/copier.rs diff --git a/crates/oakrender/src/error.rs b/crates/oak-render/src/error.rs similarity index 100% rename from crates/oakrender/src/error.rs rename to crates/oak-render/src/error.rs diff --git a/crates/oakrender/src/eval.rs b/crates/oak-render/src/eval.rs similarity index 96% rename from crates/oakrender/src/eval.rs rename to crates/oak-render/src/eval.rs index 62fe1bd95..41d77ef43 100644 --- a/crates/oakrender/src/eval.rs +++ b/crates/oak-render/src/eval.rs @@ -29,13 +29,13 @@ use std::sync::Arc; -use oakcodec::decoder::{ +use oak_codec::decoder::{ CodecStream, Decoder as _, RenderMode, RetrieveAudioStatus, RetrieveVideoParams, K_COLOR_RANGE_DEFAULT, }; -use oakcodec::ffmpeg::FFmpegDecoder; -use oakcore_rs::{PixelFormat, Rational, TimeRange}; -use oaknode::value::{NodeValue, NodeValueRow, NodeValueTable}; +use oak_codec::ffmpeg::FFmpegDecoder; +use oak_core::{PixelFormat, Rational, TimeRange}; +use oak_node::value::{NodeValue, NodeValueRow, NodeValueTable}; use crate::error::{Error, Result}; use crate::frame::VideoParamsPod; @@ -301,9 +301,9 @@ impl RenderEvalHooks { )) } - /// Executes the deferred plugin payloads a [`oaknode::nodes::plugin::PluginNode`] + /// Executes the deferred plugin payloads a [`oak_node::nodes::plugin::PluginNode`] /// pushed into its output table (C++ JobEnginePlugin processing in - /// jobmanager.cpp): unwraps each [`oaknode::nodes::plugin::PluginJobPayload`] + /// jobmanager.cpp): unwraps each [`oak_node::nodes::plugin::PluginJobPayload`] /// box, splits it into input textures and tagged param values, and /// replaces the box with the rendered texture. fn resolve_plugin_jobs(&mut self, table: &mut NodeValueTable) { @@ -315,7 +315,7 @@ impl RenderEvalHooks { continue; } let payload = unsafe { - oaknode::handle::get_checked::(handle) + oak_node::handle::get_checked::(handle) } .cloned(); let Some(payload) = payload else { @@ -329,7 +329,7 @@ impl RenderEvalHooks { for (key, v) in payload.values.iter() { match v { NodeValue::Texture(h) if !h.ctx.is_null() => { - match unsafe { oaknode::handle::get_checked::(h) }.cloned() { + match unsafe { oak_node::handle::get_checked::(h) }.cloned() { Some(texture) => inputs.push((key.clone(), texture)), None => eprintln!("plugin job input '{key}' is not a texture box"), } @@ -367,7 +367,7 @@ impl RenderEvalHooks { }; match self.process_plugin_job(src, &spec) { Ok(texture) => { - *value = NodeValue::Texture(oaknode::handle::make_owned(texture)); + *value = NodeValue::Texture(oak_node::handle::make_owned(texture)); } Err(err) => { eprintln!("plugin job resolve failed: {err:#}"); @@ -377,7 +377,7 @@ impl RenderEvalHooks { } } -impl oaknode::traverser::RenderHooks for RenderEvalHooks { +impl oak_node::traverser::RenderHooks for RenderEvalHooks { fn use_cache(&self) -> bool { self.use_cache } @@ -390,7 +390,7 @@ impl oaknode::traverser::RenderHooks for RenderEvalHooks { fn resolve( &mut self, - _node: oaknode::id::NodeId, + _node: oak_node::id::NodeId, _row: &NodeValueRow, table: &mut NodeValueTable, ) { @@ -457,11 +457,11 @@ pub fn render_produced_frame( /// Sessions are mutex-serialized inside the oakcodec box, so sharing /// one handle across worker threads is safe. static DECODERS: std::sync::OnceLock< - std::sync::Mutex>>, + std::sync::Mutex>>, > = std::sync::OnceLock::new(); fn decoders( -) -> std::sync::MutexGuard<'static, std::collections::HashMap<(String, i32), Arc>> +) -> std::sync::MutexGuard<'static, std::collections::HashMap<(String, i32), Arc>> { DECODERS .get_or_init(|| std::sync::Mutex::new(std::collections::HashMap::new())) @@ -470,14 +470,14 @@ fn decoders( } /// Open (or reuse) the decoder session for `(filename, stream_index)`. -fn open_decoder(filename: &str, stream_index: i32) -> Result> { +fn open_decoder(filename: &str, stream_index: i32) -> Result> { { let cache = decoders(); if let Some(d) = cache.get(&(filename.to_string(), stream_index)) { return Ok(d.clone()); } } - let decoder: Arc = Arc::new(FFmpegDecoder::new()); + let decoder: Arc = Arc::new(FFmpegDecoder::new()); let stream = CodecStream::with_block(filename.to_string(), stream_index, None); decoder .open(&stream) @@ -1014,7 +1014,7 @@ mod tests { #[test] fn resolve_executes_payload_box_and_keeps_plain_textures() { - use oaknode::nodes::plugin::{PluginInstanceHandle, PluginJobPayload}; + use oak_node::nodes::plugin::{PluginInstanceHandle, PluginJobPayload}; let _guard = PLUGIN_TEST_LOCK.lock().unwrap(); set_plugin_executor(Some(Arc::new(|req: &PluginJobRequest<'_>| { @@ -1048,7 +1048,7 @@ mod tests { // A real source texture box plus a payload box referencing it. let src_frame = generate_frame(Rational::new(0, 1), (2, 2), PixelFormat::F32).unwrap(); - let src_box = oaknode::handle::make_owned(Texture::wrap_frame(src_frame)); + let src_box = oak_node::handle::make_owned(Texture::wrap_frame(src_frame)); let mut values = NodeValueRow::new(); values.insert("Source".into(), NodeValue::Texture(src_box)); values.insert("gain".into(), NodeValue::Float(0.25)); @@ -1061,19 +1061,19 @@ mod tests { let mut table = NodeValueTable::default(); table.push( - oaknode::value::ValueType::Texture, - NodeValue::Texture(oaknode::handle::make_owned(payload)), + oak_node::value::ValueType::Texture, + NodeValue::Texture(oak_node::handle::make_owned(payload)), None, ); let mut hooks = RenderEvalHooks::new(); hooks.resolve_plugin_jobs(&mut table); - let NodeValue::Texture(handle) = table.get(oaknode::value::ValueType::Texture).unwrap() + let NodeValue::Texture(handle) = table.get(oak_node::value::ValueType::Texture).unwrap() else { unreachable!() }; - let rendered = unsafe { oaknode::handle::get_checked::(handle) } + let rendered = unsafe { oak_node::handle::get_checked::(handle) } .expect("payload box must be replaced by the rendered texture"); assert_eq!(first_pixel(rendered), [0.25, 0.5, 0.75, 1.0]); set_plugin_executor(None); diff --git a/crates/oakrender/src/frame.rs b/crates/oak-render/src/frame.rs similarity index 99% rename from crates/oakrender/src/frame.rs rename to crates/oak-render/src/frame.rs index e0e75c1b6..a4b030dbd 100644 --- a/crates/oakrender/src/frame.rs +++ b/crates/oak-render/src/frame.rs @@ -20,7 +20,7 @@ //! The C ABI frame functions (`oakrender_codec_frame_*`) marshal this //! type; the FFI layer stores [`Frame`] values in `OakCodecFrame` handles. -use oakcore_rs::{PixelFormat, Rational}; +use oak_core::{PixelFormat, Rational}; /// Mirror of the `oakrender_video_params` POD (include/render/renderer.h, /// field order and semantics verbatim). Stored inside [`crate::texture::Frame`] diff --git a/crates/oakrender/src/handle.rs b/crates/oak-render/src/handle.rs similarity index 99% rename from crates/oakrender/src/handle.rs rename to crates/oak-render/src/handle.rs index dafa57727..9a81e4b3b 100644 --- a/crates/oakrender/src/handle.rs +++ b/crates/oak-render/src/handle.rs @@ -45,7 +45,7 @@ struct RefBox { /// `{ctx, addref, release, abi_version}` type in `oakcore-rs`, re-exported /// here so the facade's handle scaffolding stays source-compatible. /// `Send + Sync` come from the shared type. -pub use oakcore_rs::handle::CHandle; +pub use oak_core::handle::CHandle; /// addref implementation: atomic +1 on the box's refcount. unsafe extern "C" fn refbox_addref(ctx: *mut std::ffi::c_void) { diff --git a/crates/oakrender/src/ipc.rs b/crates/oak-render/src/ipc.rs similarity index 100% rename from crates/oakrender/src/ipc.rs rename to crates/oak-render/src/ipc.rs diff --git a/crates/oakrender/src/lib.rs b/crates/oak-render/src/lib.rs similarity index 100% rename from crates/oakrender/src/lib.rs rename to crates/oak-render/src/lib.rs diff --git a/crates/oakrender/src/manager.rs b/crates/oak-render/src/manager.rs similarity index 99% rename from crates/oakrender/src/manager.rs rename to crates/oak-render/src/manager.rs index 47a215722..c003a96e2 100644 --- a/crates/oakrender/src/manager.rs +++ b/crates/oak-render/src/manager.rs @@ -217,7 +217,7 @@ impl RenderManager { /// get_default_disk_cache_path`); shared with oaknode via oakcommon /// (single-lib unification). pub fn disk_cache_path() -> String { - oakcommon::filefunctions::default_disk_cache_path() + oak_common::filefunctions::default_disk_cache_path() } /// Bytes consumed by the default disk cache folder (direct filesystem diff --git a/crates/oakrender/src/procpool.rs b/crates/oak-render/src/procpool.rs similarity index 99% rename from crates/oakrender/src/procpool.rs rename to crates/oak-render/src/procpool.rs index 0af926e95..3794d8a76 100644 --- a/crates/oakrender/src/procpool.rs +++ b/crates/oak-render/src/procpool.rs @@ -450,19 +450,19 @@ pub fn bgra8_to_f32_rgba(src: &[u8]) -> Vec { // --------------------------------------------------------------------------- /// Bytes one slot needs for `width` x `height` at a wire format -/// ([`oakcore_rs::PixelFormat`] int or [`SLOT_FORMAT_BGRA8`]). +/// ([`oak_core::PixelFormat`] int or [`SLOT_FORMAT_BGRA8`]). pub fn slot_bytes_for(width: i32, height: i32, format: i32) -> usize { let pixels = (width.max(0) as usize).saturating_mul(height.max(0) as usize); let bytes_per_pixel = if format == SLOT_FORMAT_BGRA8 { 4 } else { let fmt = match format { - 0 => oakcore_rs::PixelFormat::U8, - 1 => oakcore_rs::PixelFormat::U10, - 2 => oakcore_rs::PixelFormat::U16, - 3 => oakcore_rs::PixelFormat::F16, - 4 => oakcore_rs::PixelFormat::F32, - _ => oakcore_rs::PixelFormat::F32, + 0 => oak_core::PixelFormat::U8, + 1 => oak_core::PixelFormat::U10, + 2 => oak_core::PixelFormat::U16, + 3 => oak_core::PixelFormat::F16, + 4 => oak_core::PixelFormat::F32, + _ => oak_core::PixelFormat::F32, }; fmt.bytes_per_channel() * 4 }; @@ -612,7 +612,7 @@ pub struct DispatcherConfig { pub width: i32, /// Frame height of the segment geometry. `0` = 1080. pub height: i32, - /// Slot wire format: an `oakcore_rs::PixelFormat` int or + /// Slot wire format: an `oak_core::PixelFormat` int or /// [`SLOT_FORMAT_BGRA8`]. Default BGRA8 (the viewer preview path). pub slot_format: i32, /// Batch size `B`. `0` = the [`default_batch_size`] policy (adaptive diff --git a/crates/oakrender/src/scheduler.rs b/crates/oak-render/src/scheduler.rs similarity index 100% rename from crates/oakrender/src/scheduler.rs rename to crates/oak-render/src/scheduler.rs diff --git a/crates/oakrender/src/texture.rs b/crates/oak-render/src/texture.rs similarity index 99% rename from crates/oakrender/src/texture.rs rename to crates/oak-render/src/texture.rs index 38172af76..bab3c3304 100644 --- a/crates/oakrender/src/texture.rs +++ b/crates/oak-render/src/texture.rs @@ -18,7 +18,7 @@ use std::sync::Arc; -use oakcore_rs::{PixelFormat, Rational}; +use oak_core::{PixelFormat, Rational}; use crate::backend::{BackendKind, GpuContextLike}; use crate::error::Result; diff --git a/crates/oakrender/src/ticket.rs b/crates/oak-render/src/ticket.rs similarity index 99% rename from crates/oakrender/src/ticket.rs rename to crates/oak-render/src/ticket.rs index 902cc5f8a..617d23ff4 100644 --- a/crates/oakrender/src/ticket.rs +++ b/crates/oak-render/src/ticket.rs @@ -28,7 +28,7 @@ use std::collections::HashMap; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; use std::sync::{Arc, Condvar, Mutex, MutexGuard}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; use crate::error::{Error, Result}; use crate::eval; @@ -81,7 +81,7 @@ pub struct VideoTicketParams { /// Forced size override (None = sequence size). pub force_size: Option<(i32, i32)>, /// Forced pixel format (None = pipeline default F32). - pub force_format: Option, + pub force_format: Option, /// Frame cache to record into (cache identity). pub cache: Option, /// Cache directory (marshalled from the cache handle; frame-cache @@ -90,7 +90,7 @@ pub struct VideoTicketParams { /// Cache uuid. pub cache_id: Option, /// Cache timebase. - pub cache_timebase: Option, + pub cache_timebase: Option, /// Single-footage decode (footage node render; M12 P0). pub footage: Option<(String, i32)>, /// Sequence montage (ordered topmost-last; M12 P0). When set, the diff --git a/crates/oakrender/src/worker.rs b/crates/oak-render/src/worker.rs similarity index 99% rename from crates/oakrender/src/worker.rs rename to crates/oak-render/src/worker.rs index 2a6e52255..0a78d2524 100644 --- a/crates/oakrender/src/worker.rs +++ b/crates/oak-render/src/worker.rs @@ -38,7 +38,7 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::Rational; +use oak_core::Rational; use crate::error::{Error, Result}; use crate::procpool::ShmFrameRef; diff --git a/crates/oakrender/tests/common/mod.rs b/crates/oak-render/tests/common/mod.rs similarity index 97% rename from crates/oakrender/tests/common/mod.rs rename to crates/oak-render/tests/common/mod.rs index 3aa2efd05..8bb084ef8 100644 --- a/crates/oakrender/tests/common/mod.rs +++ b/crates/oak-render/tests/common/mod.rs @@ -34,9 +34,9 @@ impl ManagerGuard { /// test-only inline backend so no oak-worker children are spawned. pub fn init() -> Self { let guard = MANAGER_LOCK.lock().unwrap_or_else(|e| e.into_inner()); - oakrender::manager::RenderManager::shutdown(); - oakrender::manager::RenderManager::init_with_backend( - oakrender::manager::RenderBackendChoice::Threads, + oak_render::manager::RenderManager::shutdown(); + oak_render::manager::RenderManager::init_with_backend( + oak_render::manager::RenderBackendChoice::Threads, ) .expect("manager init"); Self { _guard: guard } @@ -45,7 +45,7 @@ impl ManagerGuard { impl Drop for ManagerGuard { fn drop(&mut self) { - oakrender::manager::RenderManager::shutdown(); + oak_render::manager::RenderManager::shutdown(); } } diff --git a/crates/oakrender/tests/copier_test.rs b/crates/oak-render/tests/copier_test.rs similarity index 73% rename from crates/oakrender/tests/copier_test.rs rename to crates/oak-render/tests/copier_test.rs index 722ea8e34..bfd271518 100644 --- a/crates/oakrender/tests/copier_test.rs +++ b/crates/oak-render/tests/copier_test.rs @@ -24,15 +24,15 @@ use std::sync::Arc; use std::time::Duration; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; -use oakrender::error::Error; -use oakrender::frame::VideoParamsPod; -use oakrender::texture::{Frame, Texture}; -use oakrender::ticket::TicketArena; -use oakrender::worker::{InlineDispatcher, JobDispatch}; +use oak_render::error::Error; +use oak_render::frame::VideoParamsPod; +use oak_render::texture::{Frame, Texture}; +use oak_render::ticket::TicketArena; +use oak_render::worker::{InlineDispatcher, JobDispatch}; -fn frame_producer() -> oakrender::ticket::Producer { +fn frame_producer() -> oak_render::ticket::Producer { Arc::new(|_, _| { let mut f = Frame::new(); let mut p = VideoParamsPod::default(); @@ -40,14 +40,14 @@ fn frame_producer() -> oakrender::ticket::Producer { p.height = 4; f.set_video_params(p); f.allocate(); - Ok(oakrender::ticket::TicketPayload::Video(Texture::wrap_frame(f))) + Ok(oak_render::ticket::TicketPayload::Video(Texture::wrap_frame(f))) }) } -fn cacher() -> (oakrender::autocacher::PreviewAutoCacher, Arc) { +fn cacher() -> (oak_render::autocacher::PreviewAutoCacher, Arc) { let d = InlineDispatcher::queued(); let arena = Arc::new(TicketArena::new(d.clone(), frame_producer())); - (oakrender::autocacher::PreviewAutoCacher::new(arena), d) + (oak_render::autocacher::PreviewAutoCacher::new(arena), d) } /// Deep-copy through oaknode with a valid (non-empty) project identity: @@ -56,8 +56,8 @@ fn cacher() -> (oakrender::autocacher::PreviewAutoCacher, Arc) /// caller sees today. #[test] fn deep_copy_with_valid_identity_fails_explainably() { - let mut copier = oakrender::copier::ProjectCopy::new(); - let src = oakrender::copier::ProjectHandle::new(7); + let mut copier = oak_render::copier::ProjectCopy::new(); + let src = oak_render::copier::ProjectHandle::new(7); assert_eq!( copier.set_project(src).unwrap_err().code(), Error::Failed(String::new()).code() @@ -70,11 +70,11 @@ fn deep_copy_with_valid_identity_fails_explainably() { /// no copy can ever be attached, so sync always reports the state error. #[test] fn sync_without_established_copy_fails() { - let mut copier = oakrender::copier::ProjectCopy::new(); - let src = oakrender::copier::ProjectHandle::new(7); + let mut copier = oak_render::copier::ProjectCopy::new(); + let src = oak_render::copier::ProjectHandle::new(7); assert!(copier.set_project(src).is_err()); - let changes = [oakrender::copier::ChangeRecord { - kind: oakrender::copier::change_kind::NODE_ADD, + let changes = [oak_render::copier::ChangeRecord { + kind: oak_render::copier::change_kind::NODE_ADD, payload: [0u8; 48], }]; assert_eq!( @@ -134,24 +134,24 @@ fn cancel_video_tasks_semantics() { #[test] fn change_record_marshalling() { let kinds = [ - oakrender::copier::change_kind::NODE_ADD, - oakrender::copier::change_kind::NODE_REMOVE, - oakrender::copier::change_kind::EDGE_ADD, - oakrender::copier::change_kind::EDGE_REMOVE, - oakrender::copier::change_kind::VALUE_CHANGE, - oakrender::copier::change_kind::VALUE_HINT_CHANGE, - oakrender::copier::change_kind::PROJECT_SETTING_CHANGE, - oakrender::copier::change_kind::FOOTAGE_PROXY, + oak_render::copier::change_kind::NODE_ADD, + oak_render::copier::change_kind::NODE_REMOVE, + oak_render::copier::change_kind::EDGE_ADD, + oak_render::copier::change_kind::EDGE_REMOVE, + oak_render::copier::change_kind::VALUE_CHANGE, + oak_render::copier::change_kind::VALUE_HINT_CHANGE, + oak_render::copier::change_kind::PROJECT_SETTING_CHANGE, + oak_render::copier::change_kind::FOOTAGE_PROXY, ]; for kind in kinds { - let record = oakrender::copier::ChangeRecord { + let record = oak_render::copier::ChangeRecord { kind, payload: [0xAA; 48], }; assert_eq!(record.kind, kind); assert_eq!(record.payload.len(), 48); assert_eq!( - std::mem::size_of::(), + std::mem::size_of::(), 52 ); } @@ -160,17 +160,17 @@ fn change_record_marshalling() { /// Copier failure paths (the deep-copy direction is dead). #[test] fn copier_error_paths() { - let mut copier = oakrender::copier::ProjectCopy::new(); + let mut copier = oak_render::copier::ProjectCopy::new(); assert_eq!( copier - .set_project(oakrender::copier::ProjectHandle::null()) + .set_project(oak_render::copier::ProjectHandle::null()) .unwrap_err() .code(), Error::Invalid.code() ); // sync before any project → state error. - let changes = [oakrender::copier::ChangeRecord { - kind: oakrender::copier::change_kind::NODE_ADD, + let changes = [oak_render::copier::ChangeRecord { + kind: oak_render::copier::change_kind::NODE_ADD, payload: [0u8; 48], }]; assert_eq!( diff --git a/crates/oakrender/tests/footage_decode_test.rs b/crates/oak-render/tests/footage_decode_test.rs similarity index 92% rename from crates/oakrender/tests/footage_decode_test.rs rename to crates/oak-render/tests/footage_decode_test.rs index c111c027f..385dd6073 100644 --- a/crates/oakrender/tests/footage_decode_test.rs +++ b/crates/oak-render/tests/footage_decode_test.rs @@ -22,9 +22,9 @@ //! the known pattern. The decode bridge calls into the oakcodec crate //! directly, so this runs the same real path the engine uses. -use oakcore_rs::{PixelFormat, Rational}; +use oak_core::{PixelFormat, Rational}; -use oakrender::texture::Texture; +use oak_render::texture::Texture; mod common; @@ -37,10 +37,10 @@ fn footage_decode_renders_known_content() { // Program-generated media: 10 frames at 10fps, 64x64, known pattern // (left half red, right half blue on frame 0). let path = test_clip_path(); - oakcodec::testmedia::write_test_clip(&path, 64, 64, 10, 10).expect("test clip generation"); + oak_codec::testmedia::write_test_clip(&path, 64, 64, 10, 10).expect("test clip generation"); // Decode frame 0 at native size through the eval decode path. - let tex = oakrender::eval::render_footage_frame( + let tex = oak_render::eval::render_footage_frame( &path.to_string_lossy(), 0, Rational::new(0, 1), @@ -88,7 +88,7 @@ fn footage_decode_renders_known_content() { } // Scaling: decode to a smaller proxy size keeps the known content. - let proxy = oakrender::eval::render_footage_frame( + let proxy = oak_render::eval::render_footage_frame( &path.to_string_lossy(), 0, Rational::new(0, 1), @@ -115,7 +115,7 @@ fn footage_decode_renders_known_content() { #[test] fn footage_decode_fails_explainably_for_missing_file() { - let err = oakrender::eval::render_footage_frame( + let err = oak_render::eval::render_footage_frame( "/definitely/not/here.mp4", 0, Rational::new(0, 1), diff --git a/crates/oakrender/tests/pipeline_test.rs b/crates/oak-render/tests/pipeline_test.rs similarity index 92% rename from crates/oakrender/tests/pipeline_test.rs rename to crates/oak-render/tests/pipeline_test.rs index f052e3d52..fcdbbd308 100644 --- a/crates/oakrender/tests/pipeline_test.rs +++ b/crates/oak-render/tests/pipeline_test.rs @@ -25,11 +25,11 @@ mod common; -use oakcore_rs::{PixelFormat, Rational}; +use oak_core::{PixelFormat, Rational}; -use oakrender::backend::{BackendKind, DisplayRenderer, GpuContext}; -use oakrender::frame::VideoParamsPod; -use oakrender::texture::{Frame, Texture}; +use oak_render::backend::{BackendKind, DisplayRenderer, GpuContext}; +use oak_render::frame::VideoParamsPod; +use oak_render::texture::{Frame, Texture}; /// A frame rendered through the CPU backend is F32 RGBA (not u8) and /// preserves out-of-[0,1] HDR values without clamping. @@ -37,7 +37,7 @@ use oakrender::texture::{Frame, Texture}; fn cpu_path_stays_f32_unclamped() { // The ticket producer renders the pipeline frame: F32 RGBA. let frame = - oakrender::eval::generate_frame(Rational::new(0, 1), (16, 16), PixelFormat::F32).unwrap(); + oak_render::eval::generate_frame(Rational::new(0, 1), (16, 16), PixelFormat::F32).unwrap(); assert_eq!(frame.format, PixelFormat::F32); assert_eq!(frame.channels, 4); @@ -64,11 +64,11 @@ fn cpu_path_stays_f32_unclamped() { /// (CPU path; the GPU color-managed path is documented-deferred). #[test] fn blit_applies_ocio_in_float() { - let _ = oakrender::color::set_up_default_config(); - let processor = oakrender::color::ColorProcessor::create( + let _ = oak_render::color::set_up_default_config(); + let processor = oak_render::color::ColorProcessor::create( "ACEScg", "sRGB Encoded Rec.709 (sRGB)", - oakrender::color::Direction::Normal, + oak_render::color::Direction::Normal, ) .expect("handle always returned"); if !processor.is_valid() { @@ -118,7 +118,7 @@ fn blit_applies_ocio_in_float() { .blit_color_managed( Some(&src), &mut dst, - Some(&oakrender::color::ColorProcessor::pass_through()), + Some(&oak_render::color::ColorProcessor::pass_through()), ) .unwrap(); } diff --git a/crates/oakrender/tests/ticket_worker_test.rs b/crates/oak-render/tests/ticket_worker_test.rs similarity index 89% rename from crates/oakrender/tests/ticket_worker_test.rs rename to crates/oak-render/tests/ticket_worker_test.rs index ea2de53c7..546b9ae8d 100644 --- a/crates/oakrender/tests/ticket_worker_test.rs +++ b/crates/oak-render/tests/ticket_worker_test.rs @@ -25,18 +25,18 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{mpsc, Arc}; use std::time::Duration; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; -use oakrender::error::Error; -use oakrender::frame::VideoParamsPod; -use oakrender::texture::{Frame, Texture}; -use oakrender::ticket::{TicketArena, TicketId, VideoTicketParams}; -use oakrender::worker::{GraphSnapshotStore, InlineDispatcher, JobDispatch}; +use oak_render::error::Error; +use oak_render::frame::VideoParamsPod; +use oak_render::texture::{Frame, Texture}; +use oak_render::ticket::{TicketArena, TicketId, VideoTicketParams}; +use oak_render::worker::{GraphSnapshotStore, InlineDispatcher, JobDispatch}; /// Unwrap a video ticket payload for assertions. -fn res_video(res: &oakrender::ticket::TicketPayload) -> &oakrender::texture::Texture { +fn res_video(res: &oak_render::ticket::TicketPayload) -> &oak_render::texture::Texture { match res { - oakrender::ticket::TicketPayload::Video(t) => t, + oak_render::ticket::TicketPayload::Video(t) => t, _ => panic!("expected a video payload"), } } @@ -51,8 +51,8 @@ fn small_frame() -> Frame { f } -fn ok_producer() -> oakrender::ticket::Producer { - Arc::new(|_, _| Ok(oakrender::ticket::TicketPayload::Video(Texture::wrap_frame(small_frame())))) +fn ok_producer() -> oak_render::ticket::Producer { + Arc::new(|_, _| Ok(oak_render::ticket::TicketPayload::Video(Texture::wrap_frame(small_frame())))) } fn params(time: Rational) -> VideoTicketParams { @@ -72,7 +72,7 @@ fn params(time: Rational) -> VideoTicketParams { /// An arena on a queued inline dispatcher: jobs run only when the test /// drains it with `InlineDispatcher::run` / `shutdown`. -fn test_arena(producer: oakrender::ticket::Producer) -> (TicketArena, Arc) { +fn test_arena(producer: oak_render::ticket::Producer) -> (TicketArena, Arc) { let d = InlineDispatcher::queued(); let arena = TicketArena::new(d.clone(), producer); (arena, d) @@ -101,7 +101,7 @@ fn ticket_completion_once_success() { let res = arena.result(id).unwrap().unwrap(); assert_eq!(res_video(&res).size(), (8, 4)); - assert_eq!(res_video(&res).format(), oakcore_rs::PixelFormat::F32); + assert_eq!(res_video(&res).format(), oak_core::PixelFormat::F32); assert!(arena.is_finished(id)); d.shutdown(); } diff --git a/crates/oakstorage/Cargo.lock b/crates/oak-storage/Cargo.lock similarity index 100% rename from crates/oakstorage/Cargo.lock rename to crates/oak-storage/Cargo.lock diff --git a/crates/oakstorage/Cargo.toml b/crates/oak-storage/Cargo.toml similarity index 88% rename from crates/oakstorage/Cargo.toml rename to crates/oak-storage/Cargo.toml index 0e1c96d7d..bf6701aed 100644 --- a/crates/oakstorage/Cargo.toml +++ b/crates/oak-storage/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakstorage" -version = "0.1.0" +name = "oak-storage" +version.workspace = true edition = "2021" description = "Oak Video Editor project persistence (Rust)" license = "GPL-3.0-or-later" @@ -9,8 +9,8 @@ license = "GPL-3.0-or-later" crate-type = ["staticlib", "rlib"] [dependencies] -oakcore-rs = { path = "../oakcore" } -oakcommon = { path = "../oakcommon" } +oak-core = { path = "../oak-core" } +oak-common = { path = "../oak-common" } serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["preserve_order"] } # Timestamp columns in the database schema (plan M13 §1: TIMESTAMP NOT @@ -23,9 +23,9 @@ thiserror = "2" # The node graph engine: project + serializer families power the ove-xml # backend; the sequence/track/block model powers the otio interchange # (see src/bridge/node.rs — direct Rust calls, single-lib unification). -oaknode = { path = "../oaknode" } +oak-node = { path = "../oak-node" } # Native OTIO JSON model (project-local; see src/bindings/oakotio). -oakotio = { path = "../oakotio" } +oak-otio = { path = "../oak-otio" } # Database backends via SeaORM (sync facade: a private current-thread # runtime drives the async API behind the synchronous C ABI; see # backends/database.rs). sqlx-postgres + sqlx-sqlite cover PG/SQLite. @@ -35,7 +35,7 @@ tokio = { version = "1", features = ["rt", "macros"] } # the oakundo process-wide undo stack's command-success observers, so a # recorded command immediately journals every bound project (M14 R1: the # former facade-side binding/snapshot/flush logic, now module-owned). -oakundo = { path = "../oakundo" } + oak-undo = { path = "../oak-undo" } [dev-dependencies] # oakcodec is also reachable through oaknode; the dev-dependency re-entry diff --git a/crates/oakstorage/README.md b/crates/oak-storage/README.md similarity index 100% rename from crates/oakstorage/README.md rename to crates/oak-storage/README.md diff --git a/crates/oakstorage/src/backend.rs b/crates/oak-storage/src/backend.rs similarity index 100% rename from crates/oakstorage/src/backend.rs rename to crates/oak-storage/src/backend.rs diff --git a/crates/oakstorage/src/backends/database/entities/journal.rs b/crates/oak-storage/src/backends/database/entities/journal.rs similarity index 100% rename from crates/oakstorage/src/backends/database/entities/journal.rs rename to crates/oak-storage/src/backends/database/entities/journal.rs diff --git a/crates/oakstorage/src/backends/database/entities/mod.rs b/crates/oak-storage/src/backends/database/entities/mod.rs similarity index 100% rename from crates/oakstorage/src/backends/database/entities/mod.rs rename to crates/oak-storage/src/backends/database/entities/mod.rs diff --git a/crates/oakstorage/src/backends/database/entities/project.rs b/crates/oak-storage/src/backends/database/entities/project.rs similarity index 100% rename from crates/oakstorage/src/backends/database/entities/project.rs rename to crates/oak-storage/src/backends/database/entities/project.rs diff --git a/crates/oakstorage/src/backends/database/entities/settings.rs b/crates/oak-storage/src/backends/database/entities/settings.rs similarity index 100% rename from crates/oakstorage/src/backends/database/entities/settings.rs rename to crates/oak-storage/src/backends/database/entities/settings.rs diff --git a/crates/oakstorage/src/backends/database/entities/snapshot.rs b/crates/oak-storage/src/backends/database/entities/snapshot.rs similarity index 100% rename from crates/oakstorage/src/backends/database/entities/snapshot.rs rename to crates/oak-storage/src/backends/database/entities/snapshot.rs diff --git a/crates/oakstorage/src/backends/database/migration.rs b/crates/oak-storage/src/backends/database/migration.rs similarity index 100% rename from crates/oakstorage/src/backends/database/migration.rs rename to crates/oak-storage/src/backends/database/migration.rs diff --git a/crates/oakstorage/src/backends/database/mod.rs b/crates/oak-storage/src/backends/database/mod.rs similarity index 98% rename from crates/oakstorage/src/backends/database/mod.rs rename to crates/oak-storage/src/backends/database/mod.rs index fdf28f7ad..158efde7d 100644 --- a/crates/oakstorage/src/backends/database/mod.rs +++ b/crates/oak-storage/src/backends/database/mod.rs @@ -72,8 +72,8 @@ use sea_orm::sea_query::Expr; use sea_orm::{QueryOrder, QuerySelect, Set, TransactionTrait}; use entities::{journal, project, settings, snapshot}; -use oaknode::id::NodeId; -use oaknode::project::Project; +use oak_node::id::NodeId; +use oak_node::project::Project; use crate::backend::{LoadResult, StorageBackend}; use crate::error::{Error, Result}; @@ -234,9 +234,9 @@ pub struct ProjectStats { /// counted directly in the graph. A clip that appears in more than one /// track is counted once per membership. pub fn derive_stats(p: &Project) -> ProjectStats { - use oaknode::block::{ClipBlockBehavior, GapBlockBehavior}; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior}; + use oak_node::block::{ClipBlockBehavior, GapBlockBehavior}; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior}; let mut stats = ProjectStats::default(); for id in p.graph.node_ids() { @@ -249,7 +249,7 @@ pub fn derive_stats(p: &Project) -> ProjectStats { .as_any() .and_then(|a| a.downcast_ref::()) { - let mut seq_len = oakcore_rs::Rational::new(0, 1); + let mut seq_len = oak_core::Rational::new(0, 1); for tl_id in &seq.track_lists { let tl = match p.graph.get(*tl_id).and_then(|e| { e.behavior @@ -965,7 +965,7 @@ fn serialize_project_state( /// Serialize one node as a standalone `` element (the /// same writer `serializer::save` uses inside ``). fn serialize_node_xml(p: &Project, id: NodeId) -> Result { - use oaknode::serializer::{XmlWrite, XmlWriterBridge}; + use oak_node::serializer::{XmlWrite, XmlWriterBridge}; let entry = p.graph.get(id).ok_or(Error::NotFound)?; let type_id = entry.behavior.type_id().to_string(); let connections: Vec<(NodeId, String, i32)> = p @@ -978,7 +978,7 @@ fn serialize_node_xml(p: &Project, id: NodeId) -> Result { let mut w = XmlWriterBridge::new() .ok_or_else(|| Error::Failed("oakcommon XML writer unavailable".to_string()))?; w.start_element("node"); - oaknode::serializer::save_node(&mut w, &entry.core, &*entry.behavior, id, &type_id, &connections) + oak_node::serializer::save_node(&mut w, &entry.core, &*entry.behavior, id, &type_id, &connections) .map_err(|e| Error::Format(e.to_string()))?; w.end_element(); Ok(w.output()) @@ -987,7 +987,7 @@ fn serialize_node_xml(p: &Project, id: NodeId) -> Result { /// Serialize a settings map as the `` element /// (sorted keys, exactly like `serializer::save`). fn settings_xml_from_map(settings: &HashMap) -> String { - use oaknode::serializer::{XmlWrite, XmlWriterBridge}; + use oak_node::serializer::{XmlWrite, XmlWriterBridge}; let mut w = XmlWriterBridge::new().expect("oakcommon XML writer"); w.start_element("settings"); let mut keys: Vec<&String> = settings.keys().collect(); @@ -1212,7 +1212,7 @@ async fn save_tx_once( settings_map: &HashMap, ) -> Result { let now = chrono::Utc::now().naive_utc(); - let schema_ver = oaknode::serializer::CURRENT_VERSION.0 as i32; + let schema_ver = oak_node::serializer::CURRENT_VERSION.0 as i32; let tx = conn.begin().await.map_err(db_err)?; @@ -1373,7 +1373,7 @@ async fn maybe_snapshot( .one(conn) .await .map_err(db_err)?; - let interval = oakcommon::configstore::ConfigStore::instance() + let interval = oak_common::configstore::ConfigStore::instance() .get_int(Some("Storage"), "SnapshotIntervalSec", 600); let due = match &last { None => true, @@ -1451,7 +1451,7 @@ async fn prune_snapshots(conn: &C, project_id: i64) -> Resul /// reconstructible from the snapshot plus the remaining rows (plan §1: /// history beyond the window is forfeit). async fn retention_prune(conn: &C, project_id: i64, now: DateTime) -> Result<()> { - let days = oakcommon::configstore::ConfigStore::instance() + let days = oak_common::configstore::ConfigStore::instance() .get_int(Some("Storage"), "JournalRetentionDays", 0); if days <= 0 { return Ok(()); @@ -1604,7 +1604,7 @@ mod tests { { let mut guard = p.lock().unwrap(); guard.initialize().unwrap(); - let (core, behavior) = (oaknode::factory::Factory::global() + let (core, behavior) = (oak_node::factory::Factory::global() .find("org.olivevideoeditor.Olive.math") .unwrap() .create)(); @@ -1614,7 +1614,7 @@ mod tests { .get_mut(a) .unwrap() .core - .set_standard_value("param_a_in", -1, oaknode::value::NodeValue::Float(2.5)); + .set_standard_value("param_a_in", -1, oak_node::value::NodeValue::Float(2.5)); } let guard = p.lock().unwrap(); let (nodes, settings, _) = serialize_project_state(&guard).unwrap(); @@ -1624,7 +1624,7 @@ mod tests { assert_eq!(extract_settings(&xml), settings); assert!(xml.contains(&guard.uuid)); // And the assembled document loads. - let loaded = oaknode::serializer::load(&xml).unwrap(); + let loaded = oak_node::serializer::load(&xml).unwrap(); let loaded_guard = loaded.lock().unwrap(); assert_eq!(loaded_guard.uuid, guard.uuid); assert_eq!(loaded_guard.graph.node_count(), guard.graph.node_count()); diff --git a/crates/oakstorage/src/backends/mod.rs b/crates/oak-storage/src/backends/mod.rs similarity index 100% rename from crates/oakstorage/src/backends/mod.rs rename to crates/oak-storage/src/backends/mod.rs diff --git a/crates/oakstorage/src/backends/otio.rs b/crates/oak-storage/src/backends/otio.rs similarity index 92% rename from crates/oakstorage/src/backends/otio.rs rename to crates/oak-storage/src/backends/otio.rs index ef0563b3e..95907f990 100644 --- a/crates/oakstorage/src/backends/otio.rs +++ b/crates/oak-storage/src/backends/otio.rs @@ -51,19 +51,19 @@ use std::collections::HashSet; -use oakcore_rs::Rational; -use oakotio::model::{ +use oak_core::Rational; +use oak_otio::model::{ Composable, ExternalReference, Gap, MediaReference, MissingReference, Serializable, SerializableCollection, Timeline, TimeRange, Track, Transition, }; -use oaknode::block::{ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; -use oaknode::footage::FootageBehavior; -use oaknode::graph::NodeEntry; -use oaknode::id::NodeId; -use oaknode::node::NodeCore; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_node::block::{ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; +use oak_node::footage::FootageBehavior; +use oak_node::graph::NodeEntry; +use oak_node::id::NodeId; +use oak_node::node::NodeCore; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; use crate::backend::LoadResult; use crate::nodeutil as node; @@ -117,7 +117,7 @@ impl OtioBackend { }; root.to_json_file(&path).map_err(|e| Error::Io(e.to_string())) } - "fcpxml" => oakotio::to_fcpxml_file(&timelines, &path) + "fcpxml" => oak_otio::to_fcpxml_file(&timelines, &path) .map_err(|e| Error::Io(e.to_string())), _ => Err(Error::Invalid), } @@ -150,7 +150,7 @@ impl crate::backend::StorageBackend for OtioBackend { let timelines: Vec = match ext.as_str() { "otio" => { let text = std::fs::read_to_string(&path).map_err(|e| Error::Io(e.to_string()))?; - let root = oakotio::from_json_string(&text) + let root = oak_otio::from_json_string(&text) .map_err(|e| Error::Format(e.to_string()))?; match root { Serializable::Timeline(t) => vec![t], @@ -168,7 +168,7 @@ impl crate::backend::StorageBackend for OtioBackend { } } "fcpxml" => { - oakotio::from_fcpxml_file(&path).map_err(|e| Error::Format(e.to_string()))? + oak_otio::from_fcpxml_file(&path).map_err(|e| Error::Format(e.to_string()))? } _ => return Err(Error::Invalid), }; @@ -257,7 +257,7 @@ fn project_to_timelines(project: &Project) -> Vec { /// Export one track: its kind plus one composable per block, inserting /// gaps for timeline discontinuities (oak blocks carry absolute /// positions; OTIO items are placed sequentially). -fn export_track(graph: &oaknode::graph::Graph, track: &TrackBehavior, fps: f64) -> Composable { +fn export_track(graph: &oak_node::graph::Graph, track: &TrackBehavior, fps: f64) -> Composable { let mut out = Track::new(track_kind_str(track.kind)); let mut pos = Rational::new(0, 1); for block_id in &track.blocks { @@ -281,7 +281,7 @@ fn export_track(graph: &oaknode::graph::Graph, track: &TrackBehavior, fps: f64) match kind { BlockKind::Clip => { let footage = clip_footage(graph, entry, *block_id); - let mut clip = oakotio::model::Clip::new(clip_name(graph, footage)); + let mut clip = oak_otio::model::Clip::new(clip_name(graph, footage)); let reference = footage .and_then(|fid| { graph @@ -337,7 +337,7 @@ fn sequence_fps(seq: &SequenceBehavior) -> f64 { /// The clip's display name: its footage's label, else the footage /// filename base, else "Clip". -fn clip_name(graph: &oaknode::graph::Graph, footage: Option) -> String { +fn clip_name(graph: &oak_node::graph::Graph, footage: Option) -> String { match footage { Some(fid) => { if let Some(e) = graph.get(fid) { @@ -362,7 +362,7 @@ fn clip_name(graph: &oaknode::graph::Graph, footage: Option) -> String { /// field, else the first footage node reachable upstream (mirrors /// `oaknode_node_find_input_footage`). fn clip_footage( - graph: &oaknode::graph::Graph, + graph: &oak_node::graph::Graph, entry: &NodeEntry, clip_id: NodeId, ) -> Option { @@ -401,7 +401,7 @@ fn clip_footage( /// Classify a block node into its kind plus its block core. fn classify_block( entry: &NodeEntry, -) -> (BlockKind, Option<&oaknode::block::BlockCore>) { +) -> (BlockKind, Option<&oak_node::block::BlockCore>) { entry .behavior .as_any() @@ -447,8 +447,8 @@ fn track_kind_from_str(kind: &str) -> TrackType { } /// Rational -> RationalTime at `fps` (seconds are preserved). -fn to_rt(r: Rational, fps: f64) -> oakotio::model::RationalTime { - oakotio::model::RationalTime::from_rational(r, fps) +fn to_rt(r: Rational, fps: f64) -> oak_otio::model::RationalTime { + oak_otio::model::RationalTime::from_rational(r, fps) } /// Local path -> `file://` URL (kept simple: no percent-encoding). @@ -542,13 +542,13 @@ fn import_timeline(project: &mut Project, timeline: &Timeline) -> Result<()> { .media_reference() .and_then(|m| m.as_external_reference()) .map(|e| from_file_uri(e.target_url())); - let (core, mut behavior) = oaknode::block::clip_create(); + let (core, mut behavior) = oak_node::block::clip_create(); let block_id = { let clip = behavior .as_any_mut() .and_then(|a| a.downcast_mut::()) .expect("clip_create returns a clip block"); - clip.core.range = oakcore_rs::TimeRange::new(pos, pos + len); + clip.core.range = oak_core::TimeRange::new(pos, pos + len); clip.core.media_in = media_in; clip.core.track = Some(track_id); clip.footage = None; @@ -579,13 +579,13 @@ fn import_timeline(project: &mut Project, timeline: &Timeline) -> Result<()> { .map(|r| r.duration().to_rational()) .filter(|r| !r.is_null()) .unwrap_or(Rational::new(1, 1)); - let (core, mut behavior) = oaknode::block::gap_create(); + let (core, mut behavior) = oak_node::block::gap_create(); let block_id = { let gap = behavior .as_any_mut() .and_then(|a| a.downcast_mut::()) .expect("gap_create returns a gap block"); - gap.core.range = oakcore_rs::TimeRange::new(pos, pos + len); + gap.core.range = oak_core::TimeRange::new(pos, pos + len); gap.core.track = Some(track_id); project.graph.add_node(core, behavior) }; @@ -595,7 +595,7 @@ fn import_timeline(project: &mut Project, timeline: &Timeline) -> Result<()> { Composable::Transition(t) => { // Approximate: a single transition block with its // offsets; it does not advance the timeline position. - let (core, mut behavior) = oaknode::block::transition_create(); + let (core, mut behavior) = oak_node::block::transition_create(); let block_id = { let tr = behavior .as_any_mut() @@ -604,7 +604,7 @@ fn import_timeline(project: &mut Project, timeline: &Timeline) -> Result<()> { tr.in_offset = t.in_offset().to_rational(); tr.out_offset = t.out_offset().to_rational(); tr.core.range = - oakcore_rs::TimeRange::new(pos, pos + Rational::new(1, 1)); + oak_core::TimeRange::new(pos, pos + Rational::new(1, 1)); tr.core.track = Some(track_id); project.graph.add_node(core, behavior) }; diff --git a/crates/oakstorage/src/backends/ove_xml.rs b/crates/oak-storage/src/backends/ove_xml.rs similarity index 93% rename from crates/oakstorage/src/backends/ove_xml.rs rename to crates/oak-storage/src/backends/ove_xml.rs index 5f442af79..964976c52 100644 --- a/crates/oakstorage/src/backends/ove_xml.rs +++ b/crates/oak-storage/src/backends/ove_xml.rs @@ -20,7 +20,7 @@ //! XML file I/O. //! //! The file format is the current-version `` -//! document produced by `oaknode::serializer::save`. Historical files +//! document produced by `oak_node::serializer::save`. Historical files //! carry an `` root; the backend probes the //! root element and reports TOO_OLD / TOO_NEW / UNKNOWN_VERSION per //! M10 §2.1 before delegating to the serializer. @@ -34,7 +34,7 @@ use crate::backend::LoadResult; use crate::error::{Error, OAKSTORAGE_OK, OAKSTORAGE_TOO_NEW, OAKSTORAGE_TOO_OLD, OAKSTORAGE_UNKNOWN_VERSION}; use crate::nodeutil::ProjectArc; use crate::uri::StorageUri; -use oaknode::serializer::XmlRead; +use oak_node::serializer::XmlRead; /// The ove-xml backend (`file://` + `.ove`). pub struct OveXmlBackend; @@ -56,7 +56,7 @@ enum Probe { /// `Err(())` means the document has no parseable root (corrupt input — /// the caller reports E_FORMAT, not a version info code). fn probe_version(xml: &str) -> std::result::Result { - let mut reader = oaknode::serializer::XmlReaderBridge::new(xml).ok_or(())?; + let mut reader = oak_node::serializer::XmlReaderBridge::new(xml).ok_or(())?; if !reader.next_start_element() { return Err(()); } @@ -70,8 +70,8 @@ fn probe_version(xml: &str) -> std::result::Result { "project" => Ok(Probe::Current), "olive" => match version { None => Ok(Probe::UnknownVersion), - Some(v) if v > oaknode::serializer::CURRENT_VERSION.0 => Ok(Probe::TooNew), - Some(v) if v < oaknode::serializer::CURRENT_VERSION.0 => Ok(Probe::Old), + Some(v) if v > oak_node::serializer::CURRENT_VERSION.0 => Ok(Probe::TooNew), + Some(v) if v < oak_node::serializer::CURRENT_VERSION.0 => Ok(Probe::Old), Some(_) => Ok(Probe::Current), }, _ => Ok(Probe::UnknownVersion), diff --git a/crates/oakstorage/src/error.rs b/crates/oak-storage/src/error.rs similarity index 100% rename from crates/oakstorage/src/error.rs rename to crates/oak-storage/src/error.rs diff --git a/crates/oakstorage/src/handle.rs b/crates/oak-storage/src/handle.rs similarity index 92% rename from crates/oakstorage/src/handle.rs rename to crates/oak-storage/src/handle.rs index 81a1a0b07..4cc94b64d 100644 --- a/crates/oakstorage/src/handle.rs +++ b/crates/oak-storage/src/handle.rs @@ -20,10 +20,10 @@ //! so the crate's signatures stay source-compatible with the shared type. //! //! M14 R5: oakstorage never creates its own boxes — every project handle -//! it produces goes through `oaknode::handle` (see [`crate::nodeutil`]), +//! it produces goes through `oak_node::handle` (see [`crate::nodeutil`]), //! so the per-DLL RefBox machinery is not needed here and was removed; //! only the shared `CHandle` type remains, for the facade-facing surface //! (project handles in [`crate::backend::LoadResult`] and the //! `StorageBackend` trait, the write-through binding entries). -pub use oakcore_rs::handle::CHandle; +pub use oak_core::handle::CHandle; diff --git a/crates/oakstorage/src/lib.rs b/crates/oak-storage/src/lib.rs similarity index 100% rename from crates/oakstorage/src/lib.rs rename to crates/oak-storage/src/lib.rs diff --git a/crates/oakstorage/src/nodeutil.rs b/crates/oak-storage/src/nodeutil.rs similarity index 82% rename from crates/oakstorage/src/nodeutil.rs rename to crates/oak-storage/src/nodeutil.rs index ed2000c49..ae90c3dde 100644 --- a/crates/oakstorage/src/nodeutil.rs +++ b/crates/oak-storage/src/nodeutil.rs @@ -31,7 +31,7 @@ use crate::error::Result; use crate::handle::CHandle; /// The project payload boxed by project handles. -pub type ProjectArc = Arc>; +pub type ProjectArc = Arc>; /// Box an existing project as an owned handle (refcount 1). /// @@ -40,7 +40,7 @@ pub type ProjectArc = Arc>; /// backend's `load_at`) as an oaknode project handle; everything inside /// the crate works with the boxed [`ProjectArc`] instead. pub fn make_project_owned(project: ProjectArc) -> CHandle { - oaknode::handle::make_owned(project) + oak_node::handle::make_owned(project) } /// Read the boxed project of a project handle. @@ -49,7 +49,7 @@ pub fn make_project_owned(project: ProjectArc) -> CHandle { /// The handle must box `Arc>` (created by this module or /// oaknode's project helpers). pub unsafe fn project_arc(h: &CHandle) -> Result { - unsafe { oaknode::handle::get::(h) } + unsafe { oak_node::handle::get::(h) } .cloned() .ok_or(crate::error::Error::Invalid) } @@ -69,12 +69,12 @@ pub fn release_project(h: CHandle) { /// Load a project from XML text via the oaknode serializer. pub fn serializer_load(xml: &str) -> Result { - oaknode::serializer::load(xml).map_err(|e| crate::error::Error::Format(e.to_string())) + oak_node::serializer::load(xml).map_err(|e| crate::error::Error::Format(e.to_string())) } /// Serialize a project to XML text via the oaknode serializer. -pub fn serializer_save(project: &oaknode::project::Project) -> Result { - oaknode::serializer::save(project).map_err(|e| crate::error::Error::Format(e.to_string())) +pub fn serializer_save(project: &oak_node::project::Project) -> Result { + oak_node::serializer::save(project).map_err(|e| crate::error::Error::Format(e.to_string())) } /// Create a sequence node with its default track lists (video, audio, @@ -85,24 +85,24 @@ pub fn serializer_save(project: &oaknode::project::Project) -> Result { /// `oaknode_sequence_create` export so the otio backend can import /// timelines into real projects. pub fn create_sequence( - graph: &mut oaknode::graph::Graph, -) -> (oaknode::id::NodeId, Vec) { - use oaknode::input::Input; - use oaknode::node::NodeCore; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackListBehavior, TrackType}; - use oaknode::value::{NodeValue, ValueType}; + graph: &mut oak_node::graph::Graph, +) -> (oak_node::id::NodeId, Vec) { + use oak_node::input::Input; + use oak_node::node::NodeCore; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackListBehavior, TrackType}; + use oak_node::value::{NodeValue, ValueType}; let mut seq = SequenceBehavior::new(); seq.set_default_parameters(); let mut core = NodeCore::new(); core.add_input(Input::new( - oaknode::sequence::TEXTURE_INPUT, + oak_node::sequence::TEXTURE_INPUT, ValueType::Texture, NodeValue::None, )); core.add_input(Input::new( - oaknode::sequence::SAMPLES_INPUT, + oak_node::sequence::SAMPLES_INPUT, ValueType::Samples, NodeValue::None, )); @@ -111,11 +111,11 @@ pub fn create_sequence( // `Sequence::k_track_input_format` convention). for base in 0..3 { let mut track_input = Input::new( - &oaknode::sequence::TRACK_INPUT_FORMAT.replace("%1", &base.to_string()), + &oak_node::sequence::TRACK_INPUT_FORMAT.replace("%1", &base.to_string()), ValueType::None, NodeValue::None, ); - track_input.flags |= oaknode::input::flags::ARRAY; + track_input.flags |= oak_node::input::flags::ARRAY; core.add_input(track_input); } let seq_id = graph.add_node(core, Box::new(seq)); diff --git a/crates/oakstorage/src/registry.rs b/crates/oak-storage/src/registry.rs similarity index 100% rename from crates/oakstorage/src/registry.rs rename to crates/oak-storage/src/registry.rs diff --git a/crates/oakstorage/src/session.rs b/crates/oak-storage/src/session.rs similarity index 100% rename from crates/oakstorage/src/session.rs rename to crates/oak-storage/src/session.rs diff --git a/crates/oakstorage/src/uri.rs b/crates/oak-storage/src/uri.rs similarity index 100% rename from crates/oakstorage/src/uri.rs rename to crates/oak-storage/src/uri.rs diff --git a/crates/oakstorage/src/writethrough.rs b/crates/oak-storage/src/writethrough.rs similarity index 97% rename from crates/oakstorage/src/writethrough.rs rename to crates/oak-storage/src/writethrough.rs index ed01b86ce..100154c99 100644 --- a/crates/oakstorage/src/writethrough.rs +++ b/crates/oak-storage/src/writethrough.rs @@ -21,7 +21,7 @@ //! `(library uri, project uuid)` pair — and re-saved after every //! successful undo-path operation. The module subscribes to the oakundo //! process-wide stack's **command-success observers** -//! ([`oakundo::global::add_observer`]), so each command's diff lands in +//! ([`oak_undo::global::add_observer`]), so each command's diff lands in //! the journal transactionally (the oakstorage database backend does the //! diff itself) with no facade round-trip. //! @@ -84,7 +84,7 @@ use std::panic::{catch_unwind, AssertUnwindSafe}; use std::sync::{Arc, Condvar, Mutex, OnceLock}; use std::time::Duration; -use oakundo::global; +use oak_undo::global; use crate::backends::database::DatabaseBackend; use crate::handle::CHandle; @@ -336,7 +336,7 @@ fn record_error(key: usize, message: &str) { /// are `Backend = "sqlite"` and `SqlitePath = /library.db` /// (used once storage is enabled without an explicit path). pub fn storage_enabled() -> bool { - let store = oakcommon::configstore::ConfigStore::instance(); + let store = oak_common::configstore::ConfigStore::instance(); match store.get(Some("Storage"), "Backend") { Ok(b) => b == "sqlite" || b == "database" || b == "pg", Err(_) => false, @@ -345,7 +345,7 @@ pub fn storage_enabled() -> bool { /// The configured SQLite library path (empty value = the default). fn configured_sqlite_path() -> Option { - let store = oakcommon::configstore::ConfigStore::instance(); + let store = oak_common::configstore::ConfigStore::instance(); match store.get(Some("Storage"), "SqlitePath") { Ok(p) if !p.trim().is_empty() => Some(p.trim().to_string()), _ => None, @@ -355,7 +355,7 @@ fn configured_sqlite_path() -> Option { /// The configured PostgreSQL connection string (`Storage/PgUrl`; empty /// value = not configured). fn configured_pg_url() -> Option { - let store = oakcommon::configstore::ConfigStore::instance(); + let store = oak_common::configstore::ConfigStore::instance(); match store.get(Some("Storage"), "PgUrl") { Ok(u) if !u.trim().is_empty() => Some(u.trim().to_string()), _ => None, @@ -380,7 +380,7 @@ fn pg_library_uri() -> Option { /// (`FileFunctions::get_configuration_location`: macOS Application /// Support / XDG config, honoring `OAK_CONFIG_DIR` and portable mode). pub fn default_library_path() -> String { - let dir = oakcommon::filefunctions::FileFunctions::new() + let dir = oak_common::filefunctions::FileFunctions::new() .get_configuration_location() .unwrap_or_else(|_| std::env::temp_dir().to_string_lossy().into_owned()); format!("{}/library.db", dir) @@ -390,7 +390,7 @@ pub fn default_library_path() -> String { /// cannot be made absolute, or the PG url is missing). Shared with the /// facade's library-manager exports. pub fn library_uri() -> Option { - let store = oakcommon::configstore::ConfigStore::instance(); + let store = oak_common::configstore::ConfigStore::instance(); if store.get(Some("Storage"), "Backend").ok().as_deref() == Some("pg") { return pg_library_uri(); } @@ -449,7 +449,7 @@ fn snapshot_loop() { /// seconds (default 600), with ≤ 0 treated as "every wake" and a 100 ms /// floor so the thread stays responsive to bind/stop signals. fn snapshot_tick() -> Duration { - let secs = oakcommon::configstore::ConfigStore::instance() + let secs = oak_common::configstore::ConfigStore::instance() .get_int(Some("Storage"), "SnapshotIntervalSec", 600); if secs <= 0 { Duration::from_millis(100) diff --git a/crates/oakstorage/tests/common/mod.rs b/crates/oak-storage/tests/common/mod.rs similarity index 91% rename from crates/oakstorage/tests/common/mod.rs rename to crates/oak-storage/tests/common/mod.rs index b7d24385f..1717588ab 100644 --- a/crates/oakstorage/tests/common/mod.rs +++ b/crates/oak-storage/tests/common/mod.rs @@ -34,23 +34,23 @@ use std::sync::{Arc, Mutex}; use std::time::Duration; use sea_orm::entity::prelude::*; -use oakcore_rs::Rational; -use oaknode::block::ClipBlockBehavior; -use oaknode::footage::FootageBehavior; -use oaknode::id::NodeId; -use oaknode::keyframe::{Interpolation, Keyframe}; -use oaknode::node::NodeCore; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; -use oaknode::value::NodeValue; -use oakstorage::backend::StorageBackend; -use oakstorage::backends::database::entities::settings; -use oakstorage::backends::database::DatabaseBackend; -use oakstorage::error::OAKSTORAGE_OK; -use oakstorage::handle::CHandle; -use oakstorage::nodeutil::{make_project_owned, project_arc}; -use oakstorage::uri::StorageUri; +use oak_core::Rational; +use oak_node::block::ClipBlockBehavior; +use oak_node::footage::FootageBehavior; +use oak_node::id::NodeId; +use oak_node::keyframe::{Interpolation, Keyframe}; +use oak_node::node::NodeCore; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_node::value::NodeValue; +use oak_storage::backend::StorageBackend; +use oak_storage::backends::database::entities::settings; +use oak_storage::backends::database::DatabaseBackend; +use oak_storage::error::OAKSTORAGE_OK; +use oak_storage::handle::CHandle; +use oak_storage::nodeutil::{make_project_owned, project_arc}; +use oak_storage::uri::StorageUri; // --------------------------------------------------------------------------- // URIs and paths @@ -95,7 +95,7 @@ pub(crate) fn save_project( backend: &DatabaseBackend, project: &Arc>, uri: &str, -) -> oakstorage::error::Result<()> { +) -> oak_storage::error::Result<()> { let parsed = StorageUri::parse(uri).unwrap(); let handle = make_project_owned(project.clone()); let result = backend.save(handle, &parsed, 0); @@ -219,7 +219,7 @@ pub(crate) fn uuid_of(project: &Arc>) -> String { /// Read a config value for the duration of a test (the config store is /// process-global, so restore it afterwards). pub(crate) fn with_config(group: &str, key: &str, value: i32, f: impl FnOnce()) { - let store = oakcommon::configstore::ConfigStore::instance(); + let store = oak_common::configstore::ConfigStore::instance(); let before = store.get_int(Some(group), key, 0); store.set_int(Some(group), key, value); f(); @@ -241,7 +241,7 @@ pub(crate) fn build_full_project() -> Arc> { let mut p = project.lock().unwrap(); p.initialize().unwrap(); - let (core, behavior) = (oaknode::factory::Factory::global().find(MATH).unwrap().create)(); + let (core, behavior) = (oak_node::factory::Factory::global().find(MATH).unwrap().create)(); let a = p.graph.add_node(core, behavior); { let e = p.graph.get_mut(a).unwrap(); @@ -267,7 +267,7 @@ pub(crate) fn build_full_project() -> Arc> { bezier_out: (0.3, 0.4), }); } - let (core, behavior) = (oaknode::factory::Factory::global().find(MATH).unwrap().create)(); + let (core, behavior) = (oak_node::factory::Factory::global().find(MATH).unwrap().create)(); let b = p.graph.add_node(core, behavior); p.graph .get_mut(b) @@ -278,7 +278,7 @@ pub(crate) fn build_full_project() -> Arc> { p.graph.link(a, b); // Timeline: sequence + video track + two clips with footage. - let (seq_id, lists) = oakstorage::nodeutil::create_sequence(&mut p.graph); + let (seq_id, lists) = oak_storage::nodeutil::create_sequence(&mut p.graph); p.graph.get_mut(seq_id).unwrap().core.label = "My Seq".to_string(); let mut tb = TrackBehavior::new(TrackType::Video); @@ -289,12 +289,12 @@ pub(crate) fn build_full_project() -> Arc> { .graph .add_node(NodeCore::new(), Box::new(FootageBehavior::new("/a/b.mp4"))); let clip1 = { - let (core, mut behavior) = oaknode::block::clip_create(); + let (core, mut behavior) = oak_node::block::clip_create(); let clip = behavior .as_any_mut() .and_then(|a| a.downcast_mut::()) .unwrap(); - clip.core.range = oakcore_rs::TimeRange::new(Rational::new(0, 1), Rational::new(100, 25)); + clip.core.range = oak_core::TimeRange::new(Rational::new(0, 1), Rational::new(100, 25)); clip.core.media_in = Rational::new(0, 1); clip.core.track = Some(track_id); clip.footage = Some(foot1); @@ -305,13 +305,13 @@ pub(crate) fn build_full_project() -> Arc> { .graph .add_node(NodeCore::new(), Box::new(FootageBehavior::new("/a/c.mp4"))); let clip2 = { - let (core, mut behavior) = oaknode::block::clip_create(); + let (core, mut behavior) = oak_node::block::clip_create(); let clip = behavior .as_any_mut() .and_then(|a| a.downcast_mut::()) .unwrap(); clip.core.range = - oakcore_rs::TimeRange::new(Rational::new(100, 25), Rational::new(150, 25)); + oak_core::TimeRange::new(Rational::new(100, 25), Rational::new(150, 25)); clip.core.media_in = Rational::new(10, 25); clip.core.track = Some(track_id); clip.footage = Some(foot2); diff --git a/crates/oakstorage/tests/database_pg_test.rs b/crates/oak-storage/tests/database_pg_test.rs similarity index 98% rename from crates/oakstorage/tests/database_pg_test.rs rename to crates/oak-storage/tests/database_pg_test.rs index 38437e51a..60c7ff5e3 100644 --- a/crates/oakstorage/tests/database_pg_test.rs +++ b/crates/oak-storage/tests/database_pg_test.rs @@ -34,19 +34,19 @@ use std::sync::Mutex; use sea_orm::entity::prelude::*; use sea_orm::{ConnectionTrait, QueryOrder}; -use oaknode::id::NodeId; -use oaknode::value::NodeValue; -use oakstorage::backend::StorageBackend; -use oakstorage::backends::database::entities::{journal, project, snapshot}; -use oakstorage::backends::database::{ +use oak_node::id::NodeId; +use oak_node::value::NodeValue; +use oak_storage::backend::StorageBackend; +use oak_storage::backends::database::entities::{journal, project, snapshot}; +use oak_storage::backends::database::{ derive_stats, DatabaseBackend, KIND_IMPORT, KIND_REDO, ProjectStats, SNAPSHOT_KEEP, }; -use oakstorage::error::{ +use oak_storage::error::{ OAKSTORAGE_E_FORMAT, OAKSTORAGE_E_INVALID, OAKSTORAGE_E_NOT_FOUND, OAKSTORAGE_OK, }; -use oakstorage::nodeutil::project_arc; -use oakstorage::registry::Registry; -use oakstorage::uri::StorageUri; +use oak_storage::nodeutil::project_arc; +use oak_storage::registry::Registry; +use oak_storage::uri::StorageUri; use common::*; @@ -440,7 +440,7 @@ fn pg_undo_to_any_point() { // Command 3: add a node. let (new_id, value) = { let mut p = project.lock().unwrap(); - let (core, behavior) = (oaknode::factory::Factory::global().find(MATH).unwrap().create)(); + let (core, behavior) = (oak_node::factory::Factory::global().find(MATH).unwrap().create)(); let id = p.graph.add_node(core, behavior); p.graph .get_mut(id) @@ -690,7 +690,7 @@ fn pg_list_delete_duplicate_rename() { assert_eq!(list[0].name, "Beta"); assert_eq!(list[1].name, "Alpha"); assert_eq!(list[0].command_seq, 1); - assert_eq!(list[0].schema_ver, oaknode::serializer::CURRENT_VERSION.0 as i32); + assert_eq!(list[0].schema_ver, oak_node::serializer::CURRENT_VERSION.0 as i32); // Rename (library metadata). backend diff --git a/crates/oakstorage/tests/database_test.rs b/crates/oak-storage/tests/database_test.rs similarity index 98% rename from crates/oakstorage/tests/database_test.rs rename to crates/oak-storage/tests/database_test.rs index 7861316ef..82bb6b2e3 100644 --- a/crates/oakstorage/tests/database_test.rs +++ b/crates/oak-storage/tests/database_test.rs @@ -33,20 +33,20 @@ use std::path::PathBuf; use sea_orm::entity::prelude::*; use sea_orm::QueryOrder; -use oaknode::id::NodeId; -use oaknode::value::NodeValue; -use oakstorage::backend::StorageBackend; -use oakstorage::backends::database::entities::{journal, project, snapshot}; -use oakstorage::backends::database::{ +use oak_node::id::NodeId; +use oak_node::value::NodeValue; +use oak_storage::backend::StorageBackend; +use oak_storage::backends::database::entities::{journal, project, snapshot}; +use oak_storage::backends::database::{ derive_stats, DatabaseBackend, KIND_IMPORT, KIND_REDO, ProjectStats, SNAPSHOT_KEEP, }; -use oakstorage::error::{ +use oak_storage::error::{ OAKSTORAGE_E_FORMAT, OAKSTORAGE_E_INVALID, OAKSTORAGE_E_IO, OAKSTORAGE_E_NO_BACKEND, OAKSTORAGE_E_NOT_FOUND, OAKSTORAGE_OK, }; -use oakstorage::nodeutil::project_arc; -use oakstorage::registry::Registry; -use oakstorage::uri::StorageUri; +use oak_storage::nodeutil::project_arc; +use oak_storage::registry::Registry; +use oak_storage::uri::StorageUri; use common::*; @@ -409,7 +409,7 @@ fn undo_to_any_point() { // Command 3: add a node. let (new_id, value) = { let mut p = project.lock().unwrap(); - let (core, behavior) = (oaknode::factory::Factory::global().find(MATH).unwrap().create)(); + let (core, behavior) = (oak_node::factory::Factory::global().find(MATH).unwrap().create)(); let id = p.graph.add_node(core, behavior); p.graph .get_mut(id) @@ -663,7 +663,7 @@ fn list_delete_duplicate_rename() { assert_eq!(list[0].name, "Beta"); assert_eq!(list[1].name, "Alpha"); assert_eq!(list[0].command_seq, 1); - assert_eq!(list[0].schema_ver, oaknode::serializer::CURRENT_VERSION.0 as i32); + assert_eq!(list[0].schema_ver, oak_node::serializer::CURRENT_VERSION.0 as i32); // Rename (library metadata). backend @@ -1185,7 +1185,7 @@ fn concurrent_writers_are_serialized() { // A same-uuid/seq insert conflict surfaces as a database // error (or a retried BUSY gives up). assert!( - *code == OAKSTORAGE_E_IO || *code == oakstorage::error::OAKSTORAGE_E_FAILED, + *code == OAKSTORAGE_E_IO || *code == oak_storage::error::OAKSTORAGE_E_FAILED, "writer {i} failed with unexpected code {code}" ); } diff --git a/crates/oakstorage/tests/storage_test.rs b/crates/oak-storage/tests/storage_test.rs similarity index 92% rename from crates/oakstorage/tests/storage_test.rs rename to crates/oak-storage/tests/storage_test.rs index 7ebac30a5..2f125adf8 100644 --- a/crates/oakstorage/tests/storage_test.rs +++ b/crates/oak-storage/tests/storage_test.rs @@ -22,27 +22,27 @@ use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; -use oakcore_rs::Rational; -use oaknode::block::ClipBlockBehavior; -use oaknode::footage::FootageBehavior; -use oaknode::id::NodeId; -use oaknode::keyframe::{Interpolation, Keyframe}; -use oaknode::node::NodeCore; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; -use oaknode::value::NodeValue; -use oakstorage::backend::{LoadResult, StorageBackend}; -use oakstorage::error::{ +use oak_core::Rational; +use oak_node::block::ClipBlockBehavior; +use oak_node::footage::FootageBehavior; +use oak_node::id::NodeId; +use oak_node::keyframe::{Interpolation, Keyframe}; +use oak_node::node::NodeCore; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_node::value::NodeValue; +use oak_storage::backend::{LoadResult, StorageBackend}; +use oak_storage::error::{ OAKSTORAGE_E_FORMAT, OAKSTORAGE_E_INVALID, OAKSTORAGE_E_IO, OAKSTORAGE_E_NO_BACKEND, OAKSTORAGE_E_STATE, OAKSTORAGE_OK, OAKSTORAGE_TOO_NEW, OAKSTORAGE_TOO_OLD, OAKSTORAGE_UNKNOWN_VERSION, }; -use oakstorage::handle::CHandle; -use oakstorage::nodeutil::{make_project_owned, project_arc}; -use oakstorage::registry::Registry; -use oakstorage::session::Session; -use oakstorage::uri::StorageUri; +use oak_storage::handle::CHandle; +use oak_storage::nodeutil::{make_project_owned, project_arc}; +use oak_storage::registry::Registry; +use oak_storage::session::Session; +use oak_storage::uri::StorageUri; // --------------------------------------------------------------------------- // Helpers @@ -72,13 +72,13 @@ fn release(h: CHandle) { } /// The backend claiming `uri` (Err for none / invalid URI). -fn backend_for(uri: &str) -> Result, oakstorage::error::Error> { +fn backend_for(uri: &str) -> Result, oak_storage::error::Error> { let parsed = StorageUri::parse(uri)?; Registry::global().resolve(&parsed) } /// Save `handle` to `uri` with `options`. -fn save_handle(handle: CHandle, uri: &str, options: u32) -> oakstorage::error::Result<()> { +fn save_handle(handle: CHandle, uri: &str, options: u32) -> oak_storage::error::Result<()> { let parsed = StorageUri::parse(uri)?; let backend = Registry::global().resolve(&parsed)?; backend.save(handle, &parsed, options) @@ -89,7 +89,7 @@ fn save_project( project: &Arc>, uri: &str, options: u32, -) -> oakstorage::error::Result<()> { +) -> oak_storage::error::Result<()> { let handle = make_project_owned(project.clone()); let result = save_handle(handle, uri, options); release(handle); @@ -100,7 +100,7 @@ fn save_project( /// `Err` is a hard failure (I/O, format, no backend, invalid URI); `Ok` /// carries the session plus the version info code (TOO_OLD / TOO_NEW / /// UNKNOWN_VERSION) the backend reported. -fn open(uri: &str) -> oakstorage::error::Result<(Session, i32)> { +fn open(uri: &str) -> oak_storage::error::Result<(Session, i32)> { let parsed = StorageUri::parse(uri)?; let backend = Registry::global().resolve(&parsed)?; let result = backend.load(&parsed)?; @@ -136,7 +136,7 @@ fn build_roundtrip_project() -> Arc> { let mut p = project.lock().unwrap(); p.initialize().unwrap(); - let (core, behavior) = (oaknode::factory::Factory::global().find(MATH).unwrap().create)(); + let (core, behavior) = (oak_node::factory::Factory::global().find(MATH).unwrap().create)(); let a = p.graph.add_node(core, behavior); { let e = p.graph.get_mut(a).unwrap(); @@ -162,7 +162,7 @@ fn build_roundtrip_project() -> Arc> { bezier_out: (0.3, 0.4), }); } - let (core, behavior) = (oaknode::factory::Factory::global().find(MATH).unwrap().create)(); + let (core, behavior) = (oak_node::factory::Factory::global().find(MATH).unwrap().create)(); let b = p.graph.add_node(core, behavior); p.graph .get_mut(b) @@ -323,10 +323,10 @@ fn ove_xml_compress_flag_still_round_trips() { /// round-trip before the timeline serialization landed). #[test] fn ove_xml_timeline_roundtrip() { - use oaknode::block::ClipBlockBehavior; - use oaknode::footage::FootageBehavior; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; + use oak_node::block::ClipBlockBehavior; + use oak_node::footage::FootageBehavior; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; let dir = temp_dir("ove_timeline"); let path = dir.join("timeline.ove"); @@ -531,7 +531,7 @@ impl StorageBackend for MemBackend { uri.scheme == "mem" } - fn load(&self, uri: &StorageUri) -> oakstorage::error::Result { + fn load(&self, uri: &StorageUri) -> oak_storage::error::Result { MOCK_SAVED .lock() .unwrap() @@ -546,7 +546,7 @@ impl StorageBackend for MemBackend { _project: CHandle, uri: &StorageUri, options: u32, - ) -> oakstorage::error::Result<()> { + ) -> oak_storage::error::Result<()> { MOCK_SAVED .lock() .unwrap() @@ -600,7 +600,7 @@ fn backend_pluggability() { // Unregister of an unknown name -> E_NOT_FOUND. assert_eq!( Registry::global().unregister("nope").err().unwrap().code(), - oakstorage::error::OAKSTORAGE_E_NOT_FOUND + oak_storage::error::OAKSTORAGE_E_NOT_FOUND ); } @@ -615,7 +615,7 @@ fn build_timeline_project() -> Arc> { let mut p = project.lock().unwrap(); p.initialize().unwrap(); - let (seq_id, lists) = oakstorage::nodeutil::create_sequence(&mut p.graph); + let (seq_id, lists) = oak_storage::nodeutil::create_sequence(&mut p.graph); p.graph.get_mut(seq_id).unwrap().core.label = "My Seq".to_string(); let mut tb = TrackBehavior::new(TrackType::Video); @@ -627,12 +627,12 @@ fn build_timeline_project() -> Arc> { .graph .add_node(NodeCore::new(), Box::new(FootageBehavior::new("/a/b.mp4"))); let clip1 = { - let (core, mut behavior) = oaknode::block::clip_create(); + let (core, mut behavior) = oak_node::block::clip_create(); let clip = behavior .as_any_mut() .and_then(|a| a.downcast_mut::()) .unwrap(); - clip.core.range = oakcore_rs::TimeRange::new(Rational::new(0, 1), Rational::new(100, 25)); + clip.core.range = oak_core::TimeRange::new(Rational::new(0, 1), Rational::new(100, 25)); clip.core.media_in = Rational::new(0, 1); clip.core.track = Some(track_id); clip.footage = Some(foot1); @@ -644,12 +644,12 @@ fn build_timeline_project() -> Arc> { .graph .add_node(NodeCore::new(), Box::new(FootageBehavior::new("/a/c.mp4"))); let clip2 = { - let (core, mut behavior) = oaknode::block::clip_create(); + let (core, mut behavior) = oak_node::block::clip_create(); let clip = behavior .as_any_mut() .and_then(|a| a.downcast_mut::()) .unwrap(); - clip.core.range = oakcore_rs::TimeRange::new(Rational::new(100, 25), Rational::new(150, 25)); + clip.core.range = oak_core::TimeRange::new(Rational::new(100, 25), Rational::new(150, 25)); clip.core.media_in = Rational::new(10, 25); clip.core.track = Some(track_id); clip.footage = Some(foot2); @@ -677,11 +677,11 @@ fn build_timeline_project() -> Arc> { } /// Assertions over the otio model of a written interchange file. -fn assert_otio_model(timelines: &[oakotio::Timeline]) { +fn assert_otio_model(timelines: &[oak_otio::Timeline]) { assert_eq!(timelines.len(), 1); let timeline = &timelines[0]; assert_eq!(timeline.name(), "My Seq"); - let tracks: Vec<&oakotio::Track> = timeline + let tracks: Vec<&oak_otio::Track> = timeline .tracks() .children() .iter() @@ -690,7 +690,7 @@ fn assert_otio_model(timelines: &[oakotio::Timeline]) { assert_eq!(tracks.len(), 1, "one video track"); let track = tracks[0]; assert_eq!(track.kind(), "Video"); - let clips: Vec<&oakotio::Clip> = track + let clips: Vec<&oak_otio::Clip> = track .children() .iter() .filter_map(|c| c.as_clip()) @@ -827,16 +827,16 @@ fn assert_interchange_roundtrip(ext: &str) { match ext { "otio" => { let text = std::fs::read_to_string(&path).unwrap(); - let root = oakotio::from_json_string(&text).unwrap(); - let timelines: Vec = match root { - oakotio::Serializable::Timeline(t) => vec![t], + let root = oak_otio::from_json_string(&text).unwrap(); + let timelines: Vec = match root { + oak_otio::Serializable::Timeline(t) => vec![t], other => panic!("expected a timeline root, got {}", other.schema_name()), }; assert_otio_model(&timelines); } "fcpxml" => { let text = std::fs::read_to_string(&path).unwrap(); - let timelines = oakotio::from_fcpxml_string(&text).unwrap(); + let timelines = oak_otio::from_fcpxml_string(&text).unwrap(); assert_otio_model(&timelines); } _ => unreachable!(), diff --git a/crates/oaktask/COVERAGE.md b/crates/oak-task/COVERAGE.md similarity index 100% rename from crates/oaktask/COVERAGE.md rename to crates/oak-task/COVERAGE.md diff --git a/crates/oaktask/Cargo.lock b/crates/oak-task/Cargo.lock similarity index 100% rename from crates/oaktask/Cargo.lock rename to crates/oak-task/Cargo.lock diff --git a/crates/oaktask/Cargo.toml b/crates/oak-task/Cargo.toml similarity index 81% rename from crates/oaktask/Cargo.toml rename to crates/oak-task/Cargo.toml index 197965c60..83aa765c4 100644 --- a/crates/oaktask/Cargo.toml +++ b/crates/oak-task/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oaktask" -version = "0.1.0" +name = "oak-task" +version.workspace = true edition = "2021" description = "Oak Video Editor task execution module (Rust)" license = "GPL-3.0-or-later" @@ -18,23 +18,23 @@ crate-type = ["staticlib", "rlib"] real-oakrender = [] [dependencies] -oakcore-rs = { path = "../oakcore" } -oakundo = { path = "../oakundo" } -oakcommon = { path = "../oakcommon" } -oakcodec = { path = "../oakcodec" } -oaknode = { path = "../oaknode" } +oak-core = { path = "../oak-core" } + oak-undo = { path = "../oak-undo" } +oak-common = { path = "../oak-common" } +oak-codec = { path = "../oak-codec" } +oak-node = { path = "../oak-node" } # Pure-Rust OpenTimelineIO JSON binding (serde model of the OTIO JSON format # covering exactly the object graph the C++ loadotio/saveotio tasks use). # Registered in README decision #6: OTIO no longer stays on the C++ side — # LoadOTIOTask/SaveOTIOTask parse/serialize through this crate. -oakotio = { path = "../oakotio" } +oak-otio = { path = "../oak-otio" } # oakrender is a regular path dependency (single-lib: the direct ticket # arena in `oakrender::ticket` will back the render loop once the # CHandle-based loop is rewired; until then `src/stubs.rs` stands in for # the deleted ticket C ABI). The `real-oakrender` marker feature keeps the # old render-real integration test's cargo invocation parsing (see above). -oakrender = { path = "../oakrender" } +oak-render = { path = "../oak-render" } # Error trait derive for the crate-internal error enum. thiserror = "2" diff --git a/crates/oaktask/README.md b/crates/oak-task/README.md similarity index 100% rename from crates/oaktask/README.md rename to crates/oak-task/README.md diff --git a/crates/oaktask/src/codecbridge.rs b/crates/oak-task/src/codecbridge.rs similarity index 92% rename from crates/oaktask/src/codecbridge.rs rename to crates/oak-task/src/codecbridge.rs index 01d376c84..a2d0fe372 100644 --- a/crates/oaktask/src/codecbridge.rs +++ b/crates/oak-task/src/codecbridge.rs @@ -17,16 +17,16 @@ //! Codec task submitter registration, mirroring //! `src/task/src/codecbridge.h`. //! -//! Wires oakcodec's task-submit callback (`oakcodec::task::set_task_submit_cb`) +//! Wires oakcodec's task-submit callback (`oak_codec::task::set_task_submit_cb`) //! so conform/proxy requests from the codec side land back in the task //! module. The registration is a direct Rust closure (single-lib //! unification: the old extern-C submit callback is gone). //! //! CPP-PARITY: src/task/src/codecbridge.h -use oakcodec::error::Error as CodecError; -use oakcodec::proxymanager::ProxyManager; -use oakcodec::task::{ +use oak_codec::error::Error as CodecError; +use oak_codec::proxymanager::ProxyManager; +use oak_codec::task::{ set_task_submit_cb, task_submit_is_registered, TaskKind, TaskRequest, TaskSubmitFn, }; @@ -36,7 +36,7 @@ use crate::proxy::{ProxyParams, ProxyTask}; use crate::task::Task; /// Convert oakcodec proxy params into the Rust [`ProxyParams`]. -fn proxy_params_from_codec(params: &oakcodec::proxymanager::ProxyParams) -> ProxyParams { +fn proxy_params_from_codec(params: &oak_codec::proxymanager::ProxyParams) -> ProxyParams { ProxyParams { width: params.width, height: params.height, @@ -60,7 +60,7 @@ fn cstr_buf_to_string(buf: &[u8]) -> String { fn submit_codec_task( req: &TaskRequest, _userdata: *mut std::ffi::c_void, -) -> oakcodec::error::Result<()> { +) -> oak_codec::error::Result<()> { // Build the concrete task on an outer base so the behavior can be // driven by `start()`; both share the cancellation atom. match req.kind { diff --git a/crates/oaktask/src/conform.rs b/crates/oak-task/src/conform.rs similarity index 95% rename from crates/oaktask/src/conform.rs rename to crates/oak-task/src/conform.rs index 62a169686..937e3d88d 100644 --- a/crates/oaktask/src/conform.rs +++ b/crates/oak-task/src/conform.rs @@ -19,13 +19,13 @@ //! Transcodes an audio stream to a PCM cache file (oakcodec kind //! `OAKCODEC_TASK_CONFORM`) and reports progress as it decodes. The //! decoder is reached through the direct Rust API -//! (`oakcodec::decoder::{receive_list_of_all_decoders, Decoder}`) — +//! (`oak_codec::decoder::{receive_list_of_all_decoders, Decoder}`) — //! single-lib unification; the old oakcodec decoder C ABI is gone. //! //! CPP-PARITY: src/task/src/conform/conform.h -use oakcodec::decoder::CodecStream; -use oakcodec::task::TaskRequest; +use oak_codec::decoder::CodecStream; +use oak_codec::task::TaskRequest; use crate::error::{Error, Result}; use crate::task::{Task, TaskBehavior}; @@ -45,7 +45,7 @@ pub struct ConformTask { pub sample_rate: i32, /// Target channel layout mask (ffmpeg-style). pub channel_layout: u64, - /// Target sample format (enum as int; `oakcore_rs::SampleFormat`). + /// Target sample format (enum as int; `oak_core::SampleFormat`). pub sample_format: i32, /// Resolved final per-channel filenames (from [`ConformTask::derive_filenames`]). final_names: Vec, @@ -128,7 +128,7 @@ impl TaskBehavior for ConformTask { // Pick the first registered decoder that can probe the file (the // C++ picks the decoder the footage was created with; probing in // registry order is the direct-Rust equivalent). - let decoder = oakcodec::decoder::receive_list_of_all_decoders() + let decoder = oak_codec::decoder::receive_list_of_all_decoders() .into_iter() .find(|d| d.probe(&self.input_filename, Some(&atom)).is_some()); let Some(decoder) = decoder else { diff --git a/crates/oaktask/src/customcache.rs b/crates/oak-task/src/customcache.rs similarity index 99% rename from crates/oaktask/src/customcache.rs rename to crates/oak-task/src/customcache.rs index 260078114..01622793e 100644 --- a/crates/oaktask/src/customcache.rs +++ b/crates/oak-task/src/customcache.rs @@ -24,7 +24,7 @@ use std::sync::{Arc, Condvar, Mutex}; -use oakcommon::cancelatom::CancelAtom; +use oak_common::cancelatom::CancelAtom; use crate::error::{Error, Result}; use crate::task::{Task, TaskBehavior}; diff --git a/crates/oaktask/src/error.rs b/crates/oak-task/src/error.rs similarity index 100% rename from crates/oaktask/src/error.rs rename to crates/oak-task/src/error.rs diff --git a/crates/oaktask/src/export.rs b/crates/oak-task/src/export.rs similarity index 93% rename from crates/oaktask/src/export.rs rename to crates/oak-task/src/export.rs index c6ec70b23..ec161d59e 100644 --- a/crates/oaktask/src/export.rs +++ b/crates/oak-task/src/export.rs @@ -18,7 +18,7 @@ //! //! Renders the viewer output through [`crate::render::RenderTask`] and //! writes it to a file via the direct oakcodec encoder API -//! (`oakcodec::encoder::{create_from_params, Encoder}` — single-lib +//! (`oak_codec::encoder::{create_from_params, Encoder}` — single-lib //! unification; the old encoder C ABI is gone), mapping each rendered //! frame to an `Encoder::write_video` call and each rendered audio buffer //! to `Encoder::write_audio`. @@ -27,8 +27,8 @@ //! replaced by a single [`crate::nodeops::NodeRef`] viewer (the color //! manager no longer crosses into the render tickets — the direct ticket //! arena performs no color management). Rendered frames arrive as -//! `oakrender::texture::Texture` values and are converted to -//! `oakcodec::frame::Frame` values for the encoder. +//! `oak_render::texture::Texture` values and are converted to +//! `oak_codec::frame::Frame` values for the encoder. //! //! **Simplifications over the C++**: no temporary-file rename dance (the //! encoder writes straight to the requested filename), no sidecar subtitle @@ -40,16 +40,16 @@ use std::sync::Arc; -use oakcodec::encoder::{create_from_params, Encoder}; -use oakcodec::encodingparams::EncodingParams as CodecEncodingParams; -use oakcommon::videoparams::VideoParams as CommonVideoParams; -use oakrender::texture::Texture; +use oak_codec::encoder::{create_from_params, Encoder}; +use oak_codec::encodingparams::EncodingParams as CodecEncodingParams; +use oak_common::videoparams::VideoParams as CommonVideoParams; +use oak_render::texture::Texture; use crate::error::{Error, Result}; use crate::nodeops::{self, NodeRef}; use crate::render::{ForceParams, RenderTask, RenderTaskBehavior}; use crate::task::{Task, TaskBehavior}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; /// An export task. Owns the encoder; the base [`RenderTask`] does the /// frame/audio production. @@ -66,7 +66,7 @@ pub struct ExportTask { /// Mirror of the codec encoding params, kept as plain fields so the export /// task can be configured without a codec-side handle. Only the fields the -/// task reads are declared; see `oakcodec::encodingparams::EncodingParams` +/// task reads are declared; see `oak_codec::encodingparams::EncodingParams` /// for the full inventory. pub struct EncodingParams { /// Output filename. @@ -85,7 +85,7 @@ pub struct EncodingParams { pub video_time_base_num: i32, /// Frame duration denominator. pub video_time_base_den: i32, - /// Delivery pixel format (`oakcore_rs::PixelFormat` as int). + /// Delivery pixel format (`oak_core::PixelFormat` as int). pub video_pixel_format: i32, /// Whether audio is exported. pub audio_enabled: bool, @@ -197,7 +197,7 @@ impl ExportTask { /// Copy a rendered `oakrender` CPU texture into an `oakcodec` frame /// with the matching video params (row-wise copy — line sizes may /// differ between the render and codec frame layouts). - fn to_codec_frame(texture: &Texture) -> Result { + fn to_codec_frame(texture: &Texture) -> Result { let Texture::Cpu(frame) = texture else { return Err(Error::Failed( "Render produced a GPU texture; the CPU encoder path cannot consume it" @@ -207,14 +207,14 @@ impl ExportTask { let params = CommonVideoParams::new_basic( frame.width, frame.height, - oakcommon::ocioutils::PixelFormat::from_code(frame.format as i32), + oak_common::ocioutils::PixelFormat::from_code(frame.format as i32), 4, 1, 1, 0, 1, ); - let mut out = oakcodec::frame::Frame::with_params(params); + let mut out = oak_codec::frame::Frame::with_params(params); out.set_timestamp(frame.timestamp); out.allocate().map_err(|e| { Error::Failed(format!("Failed to allocate encoder frame: {e:?}")) @@ -330,7 +330,7 @@ impl RenderTaskBehavior for ExportTask { fn audio_downloaded( &mut self, task: &mut Task, - samples: &oakrender::ticket::AudioSamples, + samples: &oak_render::ticket::AudioSamples, ) -> Result<()> { let Some(encoder) = &self.encoder else { return Ok(()); diff --git a/crates/oaktask/src/handle.rs b/crates/oak-task/src/handle.rs similarity index 98% rename from crates/oaktask/src/handle.rs rename to crates/oak-task/src/handle.rs index cf01be0cf..b12ae8ccf 100644 --- a/crates/oaktask/src/handle.rs +++ b/crates/oak-task/src/handle.rs @@ -44,7 +44,7 @@ pub struct RefBox { /// `{ctx, addref, release, abi_version}` type in `oakcore-rs`, re-exported /// here so the crate's `ffi.rs` signatures and handle scaffolding stay /// source-compatible. `Send + Sync` come from the shared type. -pub use oakcore_rs::handle::CHandle; +pub use oak_core::handle::CHandle; unsafe extern "C" fn owned_addref(ctx: *mut std::ffi::c_void) { if !ctx.is_null() { diff --git a/crates/oaktask/src/lib.rs b/crates/oak-task/src/lib.rs similarity index 94% rename from crates/oaktask/src/lib.rs rename to crates/oak-task/src/lib.rs index 9417ce1f8..dd6d5e8a1 100644 --- a/crates/oaktask/src/lib.rs +++ b/crates/oak-task/src/lib.rs @@ -18,7 +18,7 @@ //! //! Reimplements the C++ task module (`src/task/src`) as direct Rust //! (single-lib unification): inheritance → one module per class + trait -//! objects, cancellation via `oakcommon::cancelatom::CancelAtom`, events +//! objects, cancellation via `oak_common::cancelatom::CancelAtom`, events //! as boxed callbacks. All node-graph, timeline and render work goes //! through the direct `oaknode` / `oakrender` Rust APIs //! ([`nodeops`] holds the graph operations the tasks share). diff --git a/crates/oaktask/src/manager.rs b/crates/oak-task/src/manager.rs similarity index 100% rename from crates/oaktask/src/manager.rs rename to crates/oak-task/src/manager.rs diff --git a/crates/oaktask/src/nodeops.rs b/crates/oak-task/src/nodeops.rs similarity index 94% rename from crates/oaktask/src/nodeops.rs rename to crates/oak-task/src/nodeops.rs index abd5c3e5d..a56ff5614 100644 --- a/crates/oaktask/src/nodeops.rs +++ b/crates/oak-task/src/nodeops.rs @@ -20,27 +20,27 @@ //! The old `src/stubs.rs` stood in for the deleted oaknode / oaktimeline / //! oakrender C ABIs with `CHandle`-typed failure paths. Every one of those //! stubs is replaced here by real operations over `oaknode` domain types: -//! a project is `Arc>` and every node is -//! an `oaknode::id::NodeId` in that project's `oaknode::graph::Graph`. +//! a project is `Arc>` and every node is +//! an `oak_node::id::NodeId` in that project's `oak_node::graph::Graph`. //! //! Undo commands follow the oaktimeline `undocommon` pattern: a command -//! struct is boxed into an `oakundo::undocommand::UndoCommand` value +//! struct is boxed into an `oak_undo::undocommand::UndoCommand` value //! ([`box_command`]); `redo_now`/`undo_now` dispatch to it. use std::sync::{Arc, Mutex, MutexGuard}; -use oakcommon::videoparams::VideoParams as CommonVideoParams; -use oakcore_rs::Rational; -use oaknode::block::{BlockCore, ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; -use oaknode::folder::FolderBehavior; -use oaknode::footage::{FootageBehavior, StreamInfo}; -use oaknode::graph::Graph; -use oaknode::id::NodeId; -use oaknode::node::{NodeBehavior, NodeCore}; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{BlockRange, TrackBehavior, TrackListBehavior, TrackRange, TrackType}; -use oakundo::undocommand::UndoCommand; +use oak_common::videoparams::VideoParams as CommonVideoParams; +use oak_core::Rational; +use oak_node::block::{BlockCore, ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; +use oak_node::folder::FolderBehavior; +use oak_node::footage::{FootageBehavior, StreamInfo}; +use oak_node::graph::Graph; +use oak_node::id::NodeId; +use oak_node::node::{NodeBehavior, NodeCore}; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{BlockRange, TrackBehavior, TrackListBehavior, TrackRange, TrackType}; +use oak_undo::undocommand::UndoCommand; /// A project, shared like the C++ `olive::Project` smart pointer. pub type ProjectRef = Arc>; @@ -291,11 +291,11 @@ impl TrackRange for GraphTrackRange<'_> { /// Convert an oaknode video-params value to the oakcommon `VideoParams` /// value type the task code works with (the C ABI marshalled the same /// fields). -fn common_from_node_video(v: oaknode::value::VideoParams) -> CommonVideoParams { +fn common_from_node_video(v: oak_node::value::VideoParams) -> CommonVideoParams { let mut p = CommonVideoParams::new_basic( v.width, v.height, - oakcommon::ocioutils::PixelFormat::from_code(v.pixel_format), + oak_common::ocioutils::PixelFormat::from_code(v.pixel_format), v.channels, 1, 1, @@ -309,8 +309,8 @@ fn common_from_node_video(v: oaknode::value::VideoParams) -> CommonVideoParams { /// Convert an oakcommon video-params value back to the oaknode value type /// (the fields that survive the C ABI marshalling; `video_type`, /// `start_time`/`duration` and color fields have no oaknode counterpart). -fn node_video_from_common(v: &CommonVideoParams) -> oaknode::value::VideoParams { - oaknode::value::VideoParams { +fn node_video_from_common(v: &CommonVideoParams) -> oak_node::value::VideoParams { + oak_node::value::VideoParams { width: v.width(), height: v.height(), frame_rate: Rational::new(v.frame_rate().0 as i64, v.frame_rate().1 as i64), @@ -361,7 +361,7 @@ pub fn sequence_audio_params(project: &ProjectRef, sequence: NodeId) -> (i32, u6 /// keeps the call sites' shape. pub fn footage_create(project: &ProjectRef, filename: Option<&str>) -> Option { let mut guard = lock_project(project); - let (core, behavior) = oaknode::footage::FootageBehavior::create(); + let (core, behavior) = oak_node::footage::FootageBehavior::create(); let id = guard.graph.add_node(core, behavior); if let Some(filename) = filename { if let Some(entry) = guard.graph.get_mut(id) { @@ -411,7 +411,7 @@ pub fn footage_set_filename(project: &ProjectRef, footage: NodeId, filename: &st f.valid = false; entry .core - .set_standard_value("file_in", -1, oaknode::value::NodeValue::Text(filename.to_string())); + .set_standard_value("file_in", -1, oak_node::value::NodeValue::Text(filename.to_string())); if f.probe().is_err() { return false; } @@ -521,7 +521,7 @@ pub fn footage_set_video_params( /// call-site shape of the old null-handle path). pub fn folder_create(project: &ProjectRef) -> Option { let mut guard = lock_project(project); - let (core, behavior) = oaknode::folder::create(""); + let (core, behavior) = oak_node::folder::create(""); Some(guard.graph.add_node(core, behavior)) } @@ -530,7 +530,7 @@ pub fn folder_create(project: &ProjectRef) -> Option { /// the domain constructor applies the defaults itself). pub fn sequence_create(project: &ProjectRef) -> Option { let mut guard = lock_project(project); - let (core, behavior) = oaknode::sequence::SequenceBehavior::create(); + let (core, behavior) = oak_node::sequence::SequenceBehavior::create(); Some(guard.graph.add_node(core, behavior)) } @@ -686,9 +686,9 @@ pub fn track_append_block(project: &ProjectRef, track: NodeId, block: NodeId) -> pub fn block_create(project: &ProjectRef, kind: BlockKind) -> Option { let mut guard = lock_project(project); let (core, behavior): (NodeCore, Box) = match kind { - BlockKind::Clip => oaknode::block::clip_create(), - BlockKind::Gap => oaknode::block::gap_create(), - BlockKind::Transition => oaknode::block::transition_create(), + BlockKind::Clip => oak_node::block::clip_create(), + BlockKind::Gap => oak_node::block::gap_create(), + BlockKind::Transition => oak_node::block::transition_create(), BlockKind::Other => return None, }; Some(guard.graph.add_node(core, behavior)) @@ -887,17 +887,17 @@ pub fn node_find_input_footage(project: &ProjectRef, node: NodeId) -> Option oakcore_rs::PixelFormat { +pub fn pixel_format_from_code(code: i32) -> oak_core::PixelFormat { match code { - -1 => oakcore_rs::PixelFormat::Invalid, - 0 => oakcore_rs::PixelFormat::U8, - 1 => oakcore_rs::PixelFormat::U10, - 2 => oakcore_rs::PixelFormat::U16, - 3 => oakcore_rs::PixelFormat::F16, - 4 => oakcore_rs::PixelFormat::F32, - _ => oakcore_rs::PixelFormat::Invalid, + -1 => oak_core::PixelFormat::Invalid, + 0 => oak_core::PixelFormat::U8, + 1 => oak_core::PixelFormat::U10, + 2 => oak_core::PixelFormat::U16, + 3 => oak_core::PixelFormat::F16, + 4 => oak_core::PixelFormat::F32, + _ => oak_core::PixelFormat::Invalid, } } @@ -907,7 +907,7 @@ pub fn pixel_format_from_code(code: i32) -> oakcore_rs::PixelFormat { /// Command trait for the task-local undo commands (the oakundo command /// trait; mirrors the oaktimeline `undocommon::Command` pattern). -pub use oakundo::undocommand::Command as TaskCommand; +pub use oak_undo::undocommand::Command as TaskCommand; /// Box a task command into an oakundo command value. fn box_command(cmd: T) -> UndoCommand { @@ -975,7 +975,7 @@ struct RemoveNodeCommand { /// The node to remove. node: NodeId, /// The detached entry, captured at redo. - entry: Option, + entry: Option, /// The node's bin folder at redo time. folder: Option, /// The node's child index in that folder. diff --git a/crates/oaktask/src/precache.rs b/crates/oak-task/src/precache.rs similarity index 95% rename from crates/oaktask/src/precache.rs rename to crates/oak-task/src/precache.rs index 42b2c57ef..a8c308703 100644 --- a/crates/oaktask/src/precache.rs +++ b/crates/oak-task/src/precache.rs @@ -32,13 +32,13 @@ //! //! CPP-PARITY: src/task/src/precache/precachetask.h -use oakcommon::videoparams::VideoParams; +use oak_common::videoparams::VideoParams; use crate::error::Result; use crate::nodeops::{self, NodeRef}; use crate::render::{RenderTask, RenderTaskBehavior}; use crate::task::{Task, TaskBehavior}; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; /// A pre-cache task: renders frames of a footage node into the playback /// cache without any output file. @@ -114,7 +114,7 @@ impl TaskBehavior for PreCacheTask { } impl RenderTaskBehavior for PreCacheTask { - fn frame_downloaded(&mut self, task: &mut Task, frame: &oakrender::texture::Texture) -> Result<()> { + fn frame_downloaded(&mut self, task: &mut Task, frame: &oak_render::texture::Texture) -> Result<()> { // Do nothing: pre-cache just fills the frame cache (the direct // ticket arena records the render through the ticket's cache // identity; see the module docs). @@ -125,7 +125,7 @@ impl RenderTaskBehavior for PreCacheTask { fn audio_downloaded( &mut self, task: &mut Task, - buffer: &oakrender::ticket::AudioSamples, + buffer: &oak_render::ticket::AudioSamples, ) -> Result<()> { // Pre-cache doesn't cache any audio. let _ = (task, buffer); diff --git a/crates/oaktask/src/project.rs b/crates/oak-task/src/project.rs similarity index 93% rename from crates/oaktask/src/project.rs rename to crates/oak-task/src/project.rs index 226e90714..a643d8fbd 100644 --- a/crates/oaktask/src/project.rs +++ b/crates/oak-task/src/project.rs @@ -17,7 +17,7 @@ //! Project load/save/import tasks, mirroring `src/task/src/project/*`. //! //! These tasks move data through the direct oaknode domain model -//! (`Arc>` + `oaknode::id::NodeId`); +//! (`Arc>` + `oak_node::id::NodeId`); //! they borrow the project while running and hand ownership over on the //! `take_*` accessors (architectural decision #5 in README.md). diff --git a/crates/oaktask/src/project/format.rs b/crates/oak-task/src/project/format.rs similarity index 100% rename from crates/oaktask/src/project/format.rs rename to crates/oak-task/src/project/format.rs diff --git a/crates/oaktask/src/project/import.rs b/crates/oak-task/src/project/import.rs similarity index 97% rename from crates/oaktask/src/project/import.rs rename to crates/oak-task/src/project/import.rs index ed3a8c9ac..fdfc0f4f0 100644 --- a/crates/oaktask/src/project/import.rs +++ b/crates/oak-task/src/project/import.rs @@ -17,7 +17,7 @@ //! `ProjectImportTask`, mirroring `src/task/src/project/import/import.h`. //! //! Imports media files into a folder of a project. Produces an undoable -//! [`oakundo::undocommand::UndoCommand`] (taken via `take_command()`), +//! [`oak_undo::undocommand::UndoCommand`] (taken via `take_command()`), //! tracks per-file import failures, and supports an optional image-sequence //! confirmation callback. //! @@ -32,9 +32,9 @@ use std::path::Path; -use oakcommon::configstore::ConfigStore; -use oakcommon::videoparams::VideoType; -use oakundo::undocommand::UndoCommand; +use oak_common::configstore::ConfigStore; +use oak_common::videoparams::VideoType; +use oak_undo::undocommand::UndoCommand; use crate::error::{Error, Result}; use crate::nodeops::{self, NodeRef, ProjectRef}; @@ -248,7 +248,7 @@ impl ProjectImportTask { } // Direct oakcodec calls (single-lib unification). - let digit_count = oakcodec::decoder::get_image_sequence_digit_count(&filename); + let digit_count = oak_codec::decoder::get_image_sequence_digit_count(&filename); if digit_count <= 0 { return; } @@ -274,7 +274,7 @@ impl ProjectImportTask { let height = video_stream.height(); // Direct oakcodec call (single-lib unification). - let seq_index = oakcodec::decoder::get_image_sequence_index(&filename); + let seq_index = oak_codec::decoder::get_image_sequence_index(&filename); let prev_fn = transform_sequence_filename(&filename, seq_index - 1, digit_count); let next_fn = transform_sequence_filename(&filename, seq_index + 1, digit_count); diff --git a/crates/oaktask/src/project/load.rs b/crates/oak-task/src/project/load.rs similarity index 91% rename from crates/oaktask/src/project/load.rs rename to crates/oak-task/src/project/load.rs index aae53ec12..16239c987 100644 --- a/crates/oaktask/src/project/load.rs +++ b/crates/oak-task/src/project/load.rs @@ -17,11 +17,11 @@ //! `ProjectLoadBaseTask` / `ProjectLoadTask`, mirroring //! `src/task/src/project/load/load.h`. //! -//! Loads an `.oakproj` file into a new `oaknode::project::Project`. The +//! Loads an `.oakproj` file into a new `oak_node::project::Project`. The //! base task holds the filename and produces the project on //! `take_project()`; `ProjectLoadTask` is the concrete (OTIO-less) loader. //! The project itself is loaded through the direct Rust serializer -//! (`oaknode::serializer::load` — single-lib unification; the old oaknode +//! (`oak_node::serializer::load` — single-lib unification; the old oaknode //! serializer C ABI with its per-code result mapping is gone, so the //! version/result-code ladder collapses into the error message the XML //! path used). @@ -30,7 +30,7 @@ use std::sync::{Arc, Mutex}; -use oaknode::project::Project; +use oak_node::project::Project; use crate::error::{Error, Result}; use crate::task::{Task, TaskBehavior}; @@ -70,7 +70,7 @@ impl ProjectLoadBaseTask { impl TaskBehavior for ProjectLoadBaseTask { /// Load the project from `filename` via the direct oaknode serializer - /// (`oaknode::serializer::load`), storing the resulting project. + /// (`oak_node::serializer::load`), storing the resulting project. fn run(&mut self, task: &mut Task) -> Result<()> { let xml = match std::fs::read_to_string(&self.filename) { Ok(xml) => xml, @@ -84,7 +84,7 @@ impl TaskBehavior for ProjectLoadBaseTask { } }; - let project = match oaknode::serializer::load(&xml) { + let project = match oak_node::serializer::load(&xml) { Ok(project) => project, Err(e) => { task.set_error(&format!( diff --git a/crates/oaktask/src/project/loadotio.rs b/crates/oak-task/src/project/loadotio.rs similarity index 95% rename from crates/oaktask/src/project/loadotio.rs rename to crates/oak-task/src/project/loadotio.rs index 3e998d4de..45d58b961 100644 --- a/crates/oaktask/src/project/loadotio.rs +++ b/crates/oak-task/src/project/loadotio.rs @@ -29,7 +29,7 @@ //! oaktimeline C ABIs. Track creation uses the task-local //! [`crate::nodeops::add_track_command`] (see its docs for the //! oaktimeline-migration note). The loaded project is an -//! `Arc>` stored on the base task +//! `Arc>` stored on the base task //! (`take_project()`). //! //! CPP-PARITY: src/task/src/project/loadotio/loadotio.cpp @@ -38,9 +38,9 @@ use std::collections::HashMap; use std::path::Path; use std::sync::Mutex; -use oaknode::id::NodeId; -use oaknode::track::TrackType; -use oakotio::Serializable; +use oak_node::id::NodeId; +use oak_node::track::TrackType; +use oak_otio::Serializable; use crate::error::{Error, Result}; use crate::nodeops::{self, NodeRef, ProjectRef}; @@ -85,7 +85,7 @@ impl TaskBehavior for LoadOTIOTask { fn run(&mut self, task: &mut Task) -> Result<()> { // Dispatch the interchange format from the filename extension. // Format handling ends here: `parse_timelines` returns one - // `oakotio::Timeline` per sequence whatever the source format, so + // `oak_otio::Timeline` per sequence whatever the source format, so // the project building below is shared between `.otio` and // `.fcpxml` (C++ parity for the track/clip/footage code). let format = match InterchangeFormat::of(&self.base.filename) { @@ -102,7 +102,7 @@ impl TaskBehavior for LoadOTIOTask { // Build the project directly through the oaknode domain model // (the deleted `oaknode_project_init` stub is gone). - let project: ProjectRef = oaknode::project::Project::new(); + let project: ProjectRef = oak_node::project::Project::new(); { let mut guard = project.lock().unwrap_or_else(|e| e.into_inner()); if let Err(e) = guard.initialize() { @@ -270,8 +270,8 @@ impl TaskBehavior for LoadOTIOTask { let start_seconds = source_range.start_time().to_seconds(); let duration_seconds = source_range.duration().to_seconds(); - let start_time = oakcore_rs::Rational::from_double(start_seconds); - let duration = oakcore_rs::Rational::from_double(duration_seconds); + let start_time = oak_core::Rational::from_double(start_seconds); + let duration = oak_core::Rational::from_double(duration_seconds); if otio_block.schema_name() == "Clip" { nodeops::clip_set_media_in( @@ -455,7 +455,7 @@ impl TaskBehavior for LoadOTIOTask { /// Create a node from the factory registry (`oaknode_factory_create_from_id`). fn factory_create(project: &ProjectRef, type_id: &str) -> Option { - let meta = oaknode::factory::Factory::global().find(type_id)?; + let meta = oak_node::factory::Factory::global().find(type_id)?; let (core, behavior) = (meta.create)(); let mut guard = project.lock().unwrap_or_else(|e| e.into_inner()); Some(guard.graph.add_node(core, behavior)) @@ -467,13 +467,13 @@ fn set_own_context_position(project: &ProjectRef, node: NodeId) { nodeops::node_set_context_position(project, node, node, 0.0, 0.0, false); } -/// Parse the document into one `oakotio::Timeline` per sequence, dispatching +/// Parse the document into one `oak_otio::Timeline` per sequence, dispatching /// on the filename extension: /// /// - `.otio`: OpenTimelineIO JSON. A `Timeline` root yields one timeline, a /// `SerializableCollection` yields one timeline per `Timeline` child, and /// any other root is the C++ "Unknown OpenTimelineIO root element" error. -/// - `.fcpxml`: FCPXML (`oakotio::fcpxml`), one timeline per ``. +/// - `.fcpxml`: FCPXML (`oak_otio::fcpxml`), one timeline per ``. /// /// Format handling ends here — the caller builds the project from the /// returned timelines regardless of the source format (C++ parity), so the @@ -482,10 +482,10 @@ fn parse_timelines( task: &mut Task, filename: &str, format: InterchangeFormat, -) -> Result> { +) -> Result> { match format { InterchangeFormat::OtioJson => { - let root = oakotio::from_json_file(filename).map_err(|e| { + let root = oak_otio::from_json_file(filename).map_err(|e| { task.set_error(&format!( "Failed to load OpenTimelineIO from file \"{}\" \n\nOpenTimelineIO Error:\n\n{}", filename, e @@ -507,7 +507,7 @@ fn parse_timelines( } } } - InterchangeFormat::Fcpxml => oakotio::from_fcpxml_file(filename).map_err(|e| { + InterchangeFormat::Fcpxml => oak_otio::from_fcpxml_file(filename).map_err(|e| { task.set_error(&format!( "Failed to load FCPXML from file \"{}\" \n\nFCPXML Error:\n\n{}", filename, e diff --git a/crates/oaktask/src/project/save.rs b/crates/oak-task/src/project/save.rs similarity index 91% rename from crates/oaktask/src/project/save.rs rename to crates/oak-task/src/project/save.rs index 1545f18ec..bb0f23cf5 100644 --- a/crates/oaktask/src/project/save.rs +++ b/crates/oak-task/src/project/save.rs @@ -16,8 +16,8 @@ //! `ProjectSaveTask`, mirroring `src/task/src/project/save/save.h`. //! -//! Serializes a borrowed `oaknode::project::Project` to an `.oakproj` file -//! via the direct Rust serializer (`oaknode::serializer::save` — +//! Serializes a borrowed `oak_node::project::Project` to an `.oakproj` file +//! via the direct Rust serializer (`oak_node::serializer::save` — //! single-lib unification; the old oaknode serializer C ABI with its //! overwrite/compression result ladder is gone, so the overwrite-as-else //! path collapses into a plain write). Optionally writes to an override @@ -27,7 +27,7 @@ use std::sync::{Arc, Mutex}; -use oaknode::project::Project; +use oak_node::project::Project; use crate::error::{Error, Result}; use crate::task::{Task, TaskBehavior}; @@ -56,7 +56,7 @@ impl ProjectSaveTask { impl TaskBehavior for ProjectSaveTask { /// Serialize the project via the direct oaknode serializer - /// (`oaknode::serializer::save`) to the resolved filename. + /// (`oak_node::serializer::save`) to the resolved filename. fn run(&mut self, task: &mut Task) -> Result<()> { let using_filename = match &self.override_filename { Some(name) => name.clone(), @@ -75,7 +75,7 @@ impl TaskBehavior for ProjectSaveTask { )); } - let xml = match oaknode::serializer::save( + let xml = match oak_node::serializer::save( &self.project.lock().unwrap_or_else(|e| e.into_inner()), ) { Ok(xml) => xml, diff --git a/crates/oaktask/src/project/saveotio.rs b/crates/oak-task/src/project/saveotio.rs similarity index 97% rename from crates/oaktask/src/project/saveotio.rs rename to crates/oak-task/src/project/saveotio.rs index 80a3d5c34..821c8de70 100644 --- a/crates/oaktask/src/project/saveotio.rs +++ b/crates/oak-task/src/project/saveotio.rs @@ -28,14 +28,14 @@ //! oaknode domain operations in [`crate::nodeops`] (folder children, //! sequence track lists, track blocks, footage parameters) instead of the //! deleted oaknode C ABI stubs; the project is an -//! `Arc>` instead of a borrowed `CHandle`. +//! `Arc>` instead of a borrowed `CHandle`. //! //! CPP-PARITY: src/task/src/project/saveotio/saveotio.cpp -use oakcore_rs::Rational; -use oaknode::id::NodeId; -use oaknode::track::TrackType; -use oakotio::{ +use oak_core::Rational; +use oak_node::id::NodeId; +use oak_node::track::TrackType; +use oak_otio::{ Clip, Composable, ExternalReference, Gap, MediaReference, RationalTime, Serializable, SerializableCollection, TimeRange, Timeline, Track, Transition, }; @@ -278,7 +278,7 @@ impl TaskBehavior for SaveOTIOTask { fn run(&mut self, task: &mut Task) -> Result<()> { // Dispatch the interchange format from the filename extension. // Format handling ends at the write below — the serialization - // produces `oakotio::Timeline`s and is shared between `.otio` and + // produces `oak_otio::Timeline`s and is shared between `.otio` and // `.fcpxml` (C++ parity for the serialize_* helpers). let format = match InterchangeFormat::of(&self.filename) { Ok(f) => f, @@ -316,7 +316,7 @@ impl TaskBehavior for SaveOTIOTask { let Some(folder) = entry .behavior .as_any() - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) else { task.set_error("Project contains no sequences to export."); return Err(Error::Failed( @@ -375,7 +375,7 @@ impl TaskBehavior for SaveOTIOTask { } } InterchangeFormat::Fcpxml => { - oakotio::to_fcpxml_file(&serialized, &self.filename).map_err(|e| e.to_string()) + oak_otio::to_fcpxml_file(&serialized, &self.filename).map_err(|e| e.to_string()) } }; diff --git a/crates/oaktask/src/proxy.rs b/crates/oak-task/src/proxy.rs similarity index 98% rename from crates/oaktask/src/proxy.rs rename to crates/oak-task/src/proxy.rs index b8b4fe9ea..190d5a8a5 100644 --- a/crates/oaktask/src/proxy.rs +++ b/crates/oak-task/src/proxy.rs @@ -26,8 +26,8 @@ use std::io::{BufRead, BufReader}; use std::process::{Command, Stdio}; -use oakcodec::proxymanager::ProxyManager; -use oakcodec::task::TaskRequest; +use oak_codec::proxymanager::ProxyManager; +use oak_codec::task::TaskRequest; use crate::error::{Error, Result}; use crate::task::{Task, TaskBehavior}; @@ -213,7 +213,7 @@ impl TaskBehavior for ProxyTask { // unification: the old two-stage C ABI getter is gone; an empty // string means "not found"). The `FFmpegPath` config takes // precedence when set (C++ `OAK_CONFIG("FFmpegPath")`). - let configured = oakcommon::configstore::ConfigStore::instance() + let configured = oak_common::configstore::ConfigStore::instance() .get(None, "FFmpegPath") .unwrap_or_default(); let ffmpeg_path = ProxyManager::find_ffmpeg(&configured); diff --git a/crates/oaktask/src/render.rs b/crates/oak-task/src/render.rs similarity index 93% rename from crates/oaktask/src/render.rs rename to crates/oak-task/src/render.rs index 275fbf27b..3a0ca5171 100644 --- a/crates/oaktask/src/render.rs +++ b/crates/oak-task/src/render.rs @@ -18,7 +18,7 @@ //! //! The abstract parent of [`crate::export::ExportTask`] and //! [`crate::precache::PreCacheTask`]. It renders frames/audio through the -//! direct `oakrender::ticket::TicketArena` (single-lib unification: the +//! direct `oak_render::ticket::TicketArena` (single-lib unification: the //! CHandle-based ticket C ABI and `crate::stubs` are gone) and hands each //! result to a virtual hook that the subclass implements via the //! [`RenderTaskBehavior`] trait. @@ -28,7 +28,7 @@ //! (single-stream decode), sequence viewers are flattened into an ordered //! clip montage (`VideoTicketParams::montage`) resolved from the //! sequence's track lists. Tickets run on the process-wide -//! `oakrender::manager::RenderManager` arena when the manager is +//! `oak_render::manager::RenderManager` arena when the manager is //! initialized, otherwise on a private process dispatcher + arena owned //! by this render run (M15 S2: the in-process thread pool is gone). //! @@ -53,29 +53,29 @@ use std::collections::{HashMap, VecDeque}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::{Arc, Condvar, Mutex}; -use oakcommon::videoparams::VideoParams; -use oaknode::footage::FootageBehavior; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; -use oakrender::procpool::{ +use oak_common::videoparams::VideoParams; +use oak_node::footage::FootageBehavior; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_render::procpool::{ bgra8_to_f32_rgba, DispatcherConfig, ProcessDispatcher, ShmAudioRef, ShmFrameRef, }; -use oakrender::ticket::{ +use oak_render::ticket::{ ticket_kind, AudioTicketParams, MontageClip, TicketArena, TicketId, TicketPayload, TicketResult, VideoTicketParams, }; -use oakrender::worker::JobDispatch; +use oak_render::worker::JobDispatch; use crate::error::{Error, Result}; use crate::nodeops::{ find_input_footage, pixel_format_from_code, NodeRef, ProjectRef, }; use crate::task::Task; -use oakcore_rs::{Rational, TimeRange}; +use oak_core::{Rational, TimeRange}; -/// `oakrender::ticket::ticket_kind::VIDEO` re-export (loop-local kind). +/// `oak_render::ticket::ticket_kind::VIDEO` re-export (loop-local kind). const TICKET_VIDEO: i32 = ticket_kind::VIDEO; -/// `oakrender::ticket::ticket_kind::AUDIO` re-export (loop-local kind). +/// `oak_render::ticket::ticket_kind::AUDIO` re-export (loop-local kind). const TICKET_AUDIO: i32 = ticket_kind::AUDIO; /// Overrides applied to a render ticket, mirroring the C++ `ForceParams` @@ -98,7 +98,7 @@ pub struct ForceParams { pub force_matrix: [f64; 16], /// Whether `force_matrix` is in effect; retained for parity, unused. pub has_force_matrix: bool, - /// Forced pixel format (`oakcore_rs::PixelFormat` as int; -1 = off). + /// Forced pixel format (`oak_core::PixelFormat` as int; -1 = off). pub force_format: i32, /// Forced channel count (0 = off). pub force_channel_count: i32, @@ -114,10 +114,10 @@ pub trait RenderTaskBehavior { fn frame_downloaded( &mut self, task: &mut Task, - frame: &oakrender::texture::Texture, + frame: &oak_render::texture::Texture, ) -> Result<()>; /// Called for each rendered audio buffer. - fn audio_downloaded(&mut self, task: &mut Task, samples: &oakrender::ticket::AudioSamples) -> Result<()>; + fn audio_downloaded(&mut self, task: &mut Task, samples: &oak_render::ticket::AudioSamples) -> Result<()>; /// Called to encode a subtitle. fn encode_subtitle(&mut self, task: &mut Task, text: &str) -> Result<()>; } @@ -237,7 +237,7 @@ impl RenderTask { } /// The forced pixel format from [`ForceParams`], or `None`. - fn force_format(&self) -> Option { + fn force_format(&self) -> Option { if self.force_params.force_format >= 0 { Some(pixel_format_from_code(self.force_params.force_format)) } else { @@ -248,7 +248,7 @@ impl RenderTask { /// Flatten the video tracks of `sequence` into an ordered montage /// (bottom-most track first so the topmost track composites last; /// `// CPP-PARITY: M12 P0 montage contract`). - fn video_montage(project: &ProjectRef, sequence: oaknode::id::NodeId, time: Rational) -> Vec { + fn video_montage(project: &ProjectRef, sequence: oak_node::id::NodeId, time: Rational) -> Vec { let guard = project .lock() .unwrap_or_else(|e| e.into_inner()); @@ -325,7 +325,7 @@ impl RenderTask { /// Flatten the audio tracks of `sequence` into an audio montage /// (track order is irrelevant — the mixer accumulates gains). - fn audio_montage(project: &ProjectRef, sequence: oaknode::id::NodeId, time: Rational) -> Vec { + fn audio_montage(project: &ProjectRef, sequence: oak_node::id::NodeId, time: Rational) -> Vec { let guard = project .lock() .unwrap_or_else(|e| e.into_inner()); @@ -658,7 +658,7 @@ impl RenderTask { // manager is initialized, otherwise a private process dispatcher + // arena owned by this run (keeps headless/test runs // self-contained; M15 S2 — the in-process thread pool is gone). - let (arena, mut private_dispatch) = match oakrender::manager::RenderManager::global() { + let (arena, mut private_dispatch) = match oak_render::manager::RenderManager::global() { Some(manager) => (manager.tickets.clone(), None), None => { let dispatcher = ProcessDispatcher::new(DispatcherConfig::default()) @@ -666,15 +666,15 @@ impl RenderTask { dispatcher .start() .map_err(|e| Error::Failed(format!("render worker pool start: {e}")))?; - let producer: oakrender::ticket::Producer = Arc::new(|time, params| { - oakrender::eval::render_produced_frame(time, params) + let producer: oak_render::ticket::Producer = Arc::new(|time, params| { + oak_render::eval::render_produced_frame(time, params) .map(TicketPayload::Video) }); // M15 S3: the private dispatcher routes audio through the // worker pool too; the inline dispatcher is the fallback // when the dispatcher refuses a job (oversized audio ranges // / teardown). - let inline = oakrender::worker::InlineDispatcher::sync(); + let inline = oak_render::worker::InlineDispatcher::sync(); let arena = Arc::new(TicketArena::new_with_audio_fallback( dispatcher.clone(), dispatcher.clone(), @@ -688,7 +688,7 @@ impl RenderTask { // loop; the render thread must pump it while it waits (there is no // UI tick on the export thread). let pump = || { - if let Some(m) = oakrender::manager::RenderManager::global() { + if let Some(m) = oak_render::manager::RenderManager::global() { m.poll(); } else if let Some(d) = &private_dispatch { d.poll(); @@ -784,7 +784,7 @@ impl RenderTask { result = Err(e); break; } - if let Some(m) = oakrender::manager::RenderManager::global() { + if let Some(m) = oak_render::manager::RenderManager::global() { m.release_audio_frame(&audio); } else if let Some(d) = &private_dispatch { d.release_audio_frame(&audio); @@ -826,7 +826,7 @@ impl RenderTask { result = Err(e); break; } - if let Some(m) = oakrender::manager::RenderManager::global() { + if let Some(m) = oak_render::manager::RenderManager::global() { m.release_frame(&frame); } else if let Some(d) = &private_dispatch { d.release_frame(&frame); @@ -955,8 +955,8 @@ impl RenderTask { Task::new("", None), None, ( - oaknode::project::Project::new(), - oaknode::id::NodeId::INVALID, + oak_node::project::Project::new(), + oak_node::id::NodeId::INVALID, ), ForceParams::default(), None, @@ -1028,7 +1028,7 @@ impl RenderDispatch { } /// `Send` wrapper for the raw dispatch pointer captured by the ticket -/// completion callbacks (the arena's [`oakrender::ticket::Completion`] is +/// completion callbacks (the arena's [`oak_render::ticket::Completion`] is /// `Send`; the pointee outlives every ticket — see [`RenderTask::render`]'s /// `wait_idle` before freeing it). struct DispatchPtr(*mut RenderDispatch); @@ -1062,31 +1062,31 @@ fn push_finished(id: TicketId, result: TicketResult, dispatch: DispatchPtr) { /// are read straight out — their bytes are already f32 RGBA little-endian, /// no conversion; BGRA8 slots (the default preview path) convert once with /// [`bgra8_to_f32_rgba`]. -fn shm_frame_to_texture(frame: &ShmFrameRef) -> oakrender::texture::Texture { +fn shm_frame_to_texture(frame: &ShmFrameRef) -> oak_render::texture::Texture { let meta = &frame.meta; let pixels = frame .shm .slot_bytes(frame.slot) .get(..meta.data_size.max(0) as usize) .unwrap_or_default(); - if meta.format == oakcore_rs::PixelFormat::F32 as i32 { + if meta.format == oak_core::PixelFormat::F32 as i32 { // F32 slot: the encoder gets the pipeline samples with no round trip. - let mut f = oakrender::texture::Frame::new(); + let mut f = oak_render::texture::Frame::new(); f.width = meta.width; f.height = meta.height; - f.format = oakcore_rs::PixelFormat::F32; + f.format = oak_core::PixelFormat::F32; f.channels = 4; - f.timestamp = oakcore_rs::Rational::new(meta.time_num, meta.time_den); + f.timestamp = oak_core::Rational::new(meta.time_num, meta.time_den); f.data = pixels.to_vec(); - return oakrender::texture::Texture::wrap_frame(f); + return oak_render::texture::Texture::wrap_frame(f); } let samples = bgra8_to_f32_rgba(pixels); - let mut f = oakrender::texture::Frame::new(); + let mut f = oak_render::texture::Frame::new(); f.width = meta.width; f.height = meta.height; - f.format = oakcore_rs::PixelFormat::F32; + f.format = oak_core::PixelFormat::F32; f.channels = 4; - f.timestamp = oakcore_rs::Rational::new(meta.time_num, meta.time_den); + f.timestamp = oak_core::Rational::new(meta.time_num, meta.time_den); f.data = samples .chunks_exact(4) .flat_map(|px| { @@ -1097,5 +1097,5 @@ fn shm_frame_to_texture(frame: &ShmFrameRef) -> oakrender::texture::Texture { bytes }) .collect(); - oakrender::texture::Texture::wrap_frame(f) + oak_render::texture::Texture::wrap_frame(f) } diff --git a/crates/oaktask/src/task.rs b/crates/oak-task/src/task.rs similarity index 98% rename from crates/oaktask/src/task.rs rename to crates/oak-task/src/task.rs index d3c6918d5..d06670675 100644 --- a/crates/oaktask/src/task.rs +++ b/crates/oak-task/src/task.rs @@ -21,7 +21,7 @@ //! shared lifecycle lives here; the per-task work is supplied through //! [`TaskBehavior`] (a trait object, per architectural decision #1 in //! README.md). Cancellation rides on a shared -//! `oakcommon::cancelatom::CancelAtom` (single-lib unification: the old +//! `oak_common::cancelatom::CancelAtom` (single-lib unification: the old //! oakrender cancelatom C ABI is gone). //! //! CPP-PARITY: src/task/src/task.h @@ -39,7 +39,7 @@ use std::sync::atomic::{AtomicI64, Ordering}; use std::sync::{Arc, Condvar, Mutex}; -use oakcommon::cancelatom::CancelAtom; +use oak_common::cancelatom::CancelAtom; use crate::error::{Error, Result}; diff --git a/crates/oaktask/tarpaulin-report.html b/crates/oak-task/tarpaulin-report.html similarity index 100% rename from crates/oaktask/tarpaulin-report.html rename to crates/oak-task/tarpaulin-report.html diff --git a/crates/oaktask/tests/bridge_test.rs b/crates/oak-task/tests/bridge_test.rs similarity index 98% rename from crates/oaktask/tests/bridge_test.rs rename to crates/oak-task/tests/bridge_test.rs index c8a31825e..59c781338 100644 --- a/crates/oaktask/tests/bridge_test.rs +++ b/crates/oak-task/tests/bridge_test.rs @@ -20,7 +20,7 @@ use std::mem::{align_of, offset_of, size_of}; -use oaktask::handle::{make_owned, CHandle, OAKTASK_ABI_VERSION}; +use oak_task::handle::{make_owned, CHandle, OAKTASK_ABI_VERSION}; /// The exact C layout the public headers promise /// (`typedef struct OakTaskTask { void *ctx; void (*addref)(void*); diff --git a/crates/oaktask/tests/customcache_test.rs b/crates/oak-task/tests/customcache_test.rs similarity index 95% rename from crates/oaktask/tests/customcache_test.rs rename to crates/oak-task/tests/customcache_test.rs index 6590c2520..06cec0b9d 100644 --- a/crates/oaktask/tests/customcache_test.rs +++ b/crates/oak-task/tests/customcache_test.rs @@ -21,14 +21,14 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; -use oaktask::customcache::CustomCacheTask; -use oaktask::task::Task; +use oak_task::customcache::CustomCacheTask; +use oak_task::task::Task; fn spawn_parked( cc: CustomCacheTask, ) -> ( - std::thread::JoinHandle>, - Arc, + std::thread::JoinHandle>, + Arc, ) { let state = cc.state(); let atom = cc.base.get_cancel_atom(); diff --git a/crates/oaktask/tests/parity_test.rs b/crates/oak-task/tests/parity_test.rs similarity index 98% rename from crates/oaktask/tests/parity_test.rs rename to crates/oak-task/tests/parity_test.rs index a629ef34f..12b7f18df 100644 --- a/crates/oaktask/tests/parity_test.rs +++ b/crates/oak-task/tests/parity_test.rs @@ -23,8 +23,8 @@ //! (`src/task/src/conform/conform.cpp` `derive_filenames` and //! `src/task/src/proxy/proxy.cpp` `build_arguments`/`parse_progress`). -use oaktask::conform::ConformTask; -use oaktask::proxy::{ProxyParams, ProxyTask}; +use oak_task::conform::ConformTask; +use oak_task::proxy::{ProxyParams, ProxyTask}; /// Given a stereo (2-channel) first-channel final filename, derive_filenames /// returns two working and two final filenames whose suffixes match the C++ diff --git a/crates/oaktimeline/COVERAGE.md b/crates/oak-timeline/COVERAGE.md similarity index 100% rename from crates/oaktimeline/COVERAGE.md rename to crates/oak-timeline/COVERAGE.md diff --git a/crates/oaktimeline/Cargo.lock b/crates/oak-timeline/Cargo.lock similarity index 100% rename from crates/oaktimeline/Cargo.lock rename to crates/oak-timeline/Cargo.lock diff --git a/crates/oaktimeline/Cargo.toml b/crates/oak-timeline/Cargo.toml similarity index 56% rename from crates/oaktimeline/Cargo.toml rename to crates/oak-timeline/Cargo.toml index 86e871762..7b1818d7b 100644 --- a/crates/oaktimeline/Cargo.toml +++ b/crates/oak-timeline/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oaktimeline" -version = "0.1.0" +name = "oak-timeline" +version.workspace = true edition = "2021" description = "Oak Video Editor timeline edit primitives (Rust)" license = "GPL-3.0-or-later" @@ -9,9 +9,9 @@ license = "GPL-3.0-or-later" crate-type = ["staticlib", "rlib"] [dependencies] -oakcore-rs = { path = "../oakcore" } -oakundo = { path = "../oakundo" } -oaknode = { path = "../oaknode" } -oakcommon = { path = "../oakcommon" } +oak-core = { path = "../oak-core" } + oak-undo = { path = "../oak-undo" } +oak-node = { path = "../oak-node" } +oak-common = { path = "../oak-common" } # Error trait derive for the crate-internal error enum. thiserror = "2" diff --git a/crates/oaktimeline/README.md b/crates/oak-timeline/README.md similarity index 100% rename from crates/oaktimeline/README.md rename to crates/oak-timeline/README.md diff --git a/crates/oaktimeline/src/common.rs b/crates/oak-timeline/src/common.rs similarity index 99% rename from crates/oaktimeline/src/common.rs rename to crates/oak-timeline/src/common.rs index 94a722ae2..317e26d9a 100644 --- a/crates/oaktimeline/src/common.rs +++ b/crates/oak-timeline/src/common.rs @@ -22,7 +22,7 @@ //! (`OAK_TIMELINE_THUMBNAIL_*` / `OAK_TIMELINE_WAVEFORMS_*`); the deleted C //! ABI export layer used to map between them mechanically. -use oakcore_rs::Rational; +use oak_core::Rational; /// `Timeline::MovementMode` (timelinecommon.h). /// diff --git a/crates/oaktimeline/src/error.rs b/crates/oak-timeline/src/error.rs similarity index 100% rename from crates/oaktimeline/src/error.rs rename to crates/oak-timeline/src/error.rs diff --git a/crates/oaktimeline/src/handle.rs b/crates/oak-timeline/src/handle.rs similarity index 99% rename from crates/oaktimeline/src/handle.rs rename to crates/oak-timeline/src/handle.rs index 53de7ec8a..e55277e1d 100644 --- a/crates/oaktimeline/src/handle.rs +++ b/crates/oak-timeline/src/handle.rs @@ -49,7 +49,7 @@ pub struct RefBox { /// `docs/zh/plans/riir/single-lib.md`): one canonical /// `{ctx, addref, release, abi_version}` type in `oakcore-rs`, re-exported /// here so the crate's handle scaffolding stays source-compatible. -pub use oakcore_rs::handle::CHandle; +pub use oak_core::handle::CHandle; /// Generic `addref` implementation: increments the box's reference count. /// diff --git a/crates/oaktimeline/src/lib.rs b/crates/oak-timeline/src/lib.rs similarity index 88% rename from crates/oaktimeline/src/lib.rs rename to crates/oak-timeline/src/lib.rs index bb95cf4da..9ddc6a7d4 100644 --- a/crates/oaktimeline/src/lib.rs +++ b/crates/oak-timeline/src/lib.rs @@ -24,11 +24,11 @@ //! //! The C ABI export layer (`ffi.rs`) and the oaknode/oakundo/oakcommon //! bridge (`bridge/`) were deleted in the single-lib unification: undo -//! commands are now `oakundo::undocommand::UndoCommand` values (the +//! commands are now `oak_undo::undocommand::UndoCommand` values (the //! crate's command structs implement `undocommon::Command` and are boxed //! as trait objects) and every node/block/track reference is a -//! [`util::NodeRef`] — an `Arc>` + -//! `oaknode::id::NodeId` pair that the commands manipulate through the +//! [`util::NodeRef`] — an `Arc>` + +//! `oak_node::id::NodeId` pair that the commands manipulate through the //! oaknode Rust domain directly. #![deny(unsafe_op_in_unsafe_fn)] diff --git a/crates/oaktimeline/src/marker.rs b/crates/oak-timeline/src/marker.rs similarity index 99% rename from crates/oaktimeline/src/marker.rs rename to crates/oak-timeline/src/marker.rs index c3b748d98..143a1f27d 100644 --- a/crates/oaktimeline/src/marker.rs +++ b/crates/oak-timeline/src/marker.rs @@ -27,8 +27,8 @@ use std::sync::{Arc, Mutex}; -use oakcore_rs::{Rational, TimeRange}; -use oakundo::undocommand::UndoCommand; +use oak_core::{Rational, TimeRange}; +use oak_undo::undocommand::UndoCommand; use crate::handle::get; use crate::undocommon::{box_command, Command}; diff --git a/crates/oaktimeline/src/multicam.rs b/crates/oak-timeline/src/multicam.rs similarity index 98% rename from crates/oaktimeline/src/multicam.rs rename to crates/oak-timeline/src/multicam.rs index 5d15bf8c4..5f96c05c1 100644 --- a/crates/oaktimeline/src/multicam.rs +++ b/crates/oak-timeline/src/multicam.rs @@ -19,7 +19,7 @@ //! `app/widget/timelinewidget/timelinewidget.cpp::multicam_enabled_triggered`). //! //! A multi-cam clip is a clip whose effect input (`tex_in`, C++ -//! `buffer_in`) is fed by a [`MultiCamNode`] (`oaknode::nodes::multicamnode`). +//! `buffer_in`) is fed by a [`MultiCamNode`] (`oak_node::nodes::multicamnode`). //! The node's `sequence_in` connects to the sequence whose track list //! supplies the angles; `sources_in` carries no real edges — the render //! resolves element `i` to track `i` of the selected track list @@ -48,17 +48,17 @@ use std::collections::HashSet; use std::sync::{Arc, Mutex}; -use oakcore_rs::Rational; -use oaknode::block::clip_input; -use oaknode::graph::{Graph, NodeEntry}; -use oaknode::id::NodeId; -use oaknode::nodes::multicamnode::{ +use oak_core::Rational; +use oak_node::block::clip_input; +use oak_node::graph::{Graph, NodeEntry}; +use oak_node::id::NodeId; +use oak_node::nodes::multicamnode::{ MultiCamNode, CURRENT_INPUT, SEQUENCE_INPUT, SEQUENCE_TYPE_INPUT, }; -use oaknode::project::Project; -use oaknode::track::TrackType; -use oaknode::value::NodeValue; -use oakundo::undocommand::UndoCommand; +use oak_node::project::Project; +use oak_node::track::TrackType; +use oak_node::value::NodeValue; +use oak_undo::undocommand::UndoCommand; use crate::util::{ block_in, block_kind, block_out, block_track, BlockKind, NodeRef, @@ -223,7 +223,7 @@ fn clip_track_type(clip: &NodeRef) -> TrackType { p.graph .get(track.id) .and_then(|e| e.behavior.as_any()) - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .map(|t| t.kind) }) .unwrap_or(TrackType::Video) @@ -315,7 +315,7 @@ impl MultiCamEnableCommand { let project = self.sequence.project.clone(); for clip in &self.clips { let mc = { - let (core, behavior) = oaknode::nodes::multicamnode::create(); + let (core, behavior) = oak_node::nodes::multicamnode::create(); let mut p = project.lock().unwrap_or_else(|poisoned| poisoned.into_inner()); p.graph.add_node(core, behavior) }; @@ -722,11 +722,11 @@ mod tests { block_clip_create, block_in, block_length, block_out, same_block, track_append_block, track_block_at, track_block_count, NodeRef, }; - use oakcore_rs::TimeRange; - use oaknode::block::ClipBlockBehavior; - use oaknode::node::NodeCore; - use oaknode::sequence::SequenceBehavior; - use oaknode::track::{TrackBehavior, TrackListBehavior}; + use oak_core::TimeRange; + use oak_node::block::ClipBlockBehavior; + use oak_node::node::NodeCore; + use oak_node::sequence::SequenceBehavior; + use oak_node::track::{TrackBehavior, TrackListBehavior}; /// Project fixture: a sequence owning one video track list with one /// video track. diff --git a/crates/oaktimeline/src/undocommon.rs b/crates/oak-timeline/src/undocommon.rs similarity index 95% rename from crates/oaktimeline/src/undocommon.rs rename to crates/oak-timeline/src/undocommon.rs index 36d1160af..2b2d256c1 100644 --- a/crates/oaktimeline/src/undocommon.rs +++ b/crates/oak-timeline/src/undocommon.rs @@ -16,7 +16,7 @@ //! Shared node-removal helpers and the command wrapper //! (`src/timeline/src/timelineundocommon.h`). Since the single-lib -//! unification, commands are `oakundo::undocommand::UndoCommand` values +//! unification, commands are `oak_undo::undocommand::UndoCommand` values //! (the oakundo C ABI and the oaknode C ABI are both gone); node-graph //! access goes directly through the oaknode Rust domain //! ([`crate::util::NodeRef`] + the project's graph arena). @@ -24,10 +24,10 @@ //! `CHandleCommandWrapper` in C++ subclasses `olive::UndoCommand` to wrap a //! raw `OakUndoCommand`; the Rust equivalent is the crate's own commands //! boxed as trait objects through [`box_command`] (they implement -//! [`Command`] = `oakundo::undocommand::Command`), so the wrapper is gone. +//! [`Command`] = `oak_undo::undocommand::Command`), so the wrapper is gone. -use oaknode::graph::NodeEntry; -use oakundo::undocommand::UndoCommand; +use oak_node::graph::NodeEntry; +use oak_undo::undocommand::UndoCommand; use crate::util::{block_add_to_graph, block_remove_from_graph, NodeRef}; @@ -104,7 +104,7 @@ pub fn create_and_run_block_remove_command(block: &NodeRef) -> UndoCommand { /// oakundo command trait). The crate's commands are boxed into an /// [`UndoCommand`] via [`box_command`]; the command's /// `redo_now`/`undo_now` dispatch to these callbacks. -pub use oakundo::undocommand::Command; +pub use oak_undo::undocommand::Command; /// Box a command into an oakundo command value. The command owns the /// boxed `T`; `redo_now`/`undo_now` dispatch to `T::redo`/`T::undo`, and diff --git a/crates/oaktimeline/src/undogeneral.rs b/crates/oak-timeline/src/undogeneral.rs similarity index 97% rename from crates/oaktimeline/src/undogeneral.rs rename to crates/oak-timeline/src/undogeneral.rs index 51ac0abfb..3e5cdf3b2 100644 --- a/crates/oaktimeline/src/undogeneral.rs +++ b/crates/oak-timeline/src/undogeneral.rs @@ -20,15 +20,15 @@ //! //! Graph mutation routes directly through the oaknode Rust domain (the //! oaknode C ABI was deleted in the single-lib unification); command -//! wrapping through `oakundo::undocommand::UndoCommand` values. Commands +//! wrapping through `oak_undo::undocommand::UndoCommand` values. Commands //! that compose child commands own them as plain structs rather than //! pointers (see `undocommon`). Detached blocks are held as owned arena //! entries on the command that detached them. -use oakcore_rs::Rational; -use oaknode::graph::NodeEntry; -use oaknode::track::TrackType; -use oakundo::undocommand::UndoCommand; +use oak_core::Rational; +use oak_node::graph::NodeEntry; +use oak_node::track::TrackType; +use oak_undo::undocommand::UndoCommand; use crate::undocommon::{box_command, create_block_remove_command, Command}; use crate::undosplit::BlockSplitPreservingLinksCommand; @@ -389,7 +389,7 @@ impl TimelineRemoveTrackCommand { let Some(behavior) = entry.behavior.as_any() else { return; }; - let Some(track_behavior) = behavior.downcast_ref::() + let Some(track_behavior) = behavior.downcast_ref::() else { return; }; @@ -402,7 +402,7 @@ impl TimelineRemoveTrackCommand { let index = list_entry .behavior .as_any() - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .and_then(|l| l.track_index(self.track.id)); (list_id, index) }; @@ -420,7 +420,7 @@ impl TimelineRemoveTrackCommand { // First pass: remove the track from the list and collect the ids of // the tracks after it (their indexes shift). let mut removed = false; - let mut later: Vec = Vec::new(); + let mut later: Vec = Vec::new(); { let mut p = self .track @@ -429,7 +429,7 @@ impl TimelineRemoveTrackCommand { .unwrap_or_else(|poisoned| poisoned.into_inner()); if let Some(entry) = p.graph.get_mut(list.id) { if let Some(a) = entry.behavior.as_any_mut() { - if let Some(l) = a.downcast_mut::() { + if let Some(l) = a.downcast_mut::() { if let Some(i) = l.tracks.iter().position(|t| *t == self.track.id) { l.tracks.remove(i); later = l.tracks[i..].to_vec(); @@ -450,7 +450,7 @@ impl TimelineRemoveTrackCommand { for t in &later { if let Some(te) = p.graph.get_mut(*t) { if let Some(ta) = te.behavior.as_any_mut() { - if let Some(tb) = ta.downcast_mut::() { + if let Some(tb) = ta.downcast_mut::() { if tb.index > index.unwrap_or(0) as i32 { tb.index -= 1; } @@ -479,7 +479,7 @@ impl TimelineRemoveTrackCommand { let index = self.index.unwrap_or(0); // Re-insert the track into the list and collect the tracks after it // (their indexes shift). - let later: Vec = 'block: { + let later: Vec = 'block: { let mut p = self .track .project @@ -487,7 +487,7 @@ impl TimelineRemoveTrackCommand { .unwrap_or_else(|poisoned| poisoned.into_inner()); if let Some(entry) = p.graph.get_mut(list.id) { if let Some(a) = entry.behavior.as_any_mut() { - if let Some(l) = a.downcast_mut::() { + if let Some(l) = a.downcast_mut::() { let insert_at = index.min(l.tracks.len()); l.tracks.insert(insert_at, self.track.id); break 'block l.tracks[insert_at + 1..].to_vec(); @@ -504,7 +504,7 @@ impl TimelineRemoveTrackCommand { for t in &later { if let Some(te) = p.graph.get_mut(*t) { if let Some(ta) = te.behavior.as_any_mut() { - if let Some(tb) = ta.downcast_mut::() { + if let Some(tb) = ta.downcast_mut::() { if tb.index >= index as i32 { tb.index += 1; } @@ -514,7 +514,7 @@ impl TimelineRemoveTrackCommand { } if let Some(entry) = p.graph.get_mut(self.track.id) { if let Some(a) = entry.behavior.as_any_mut() { - if let Some(tb) = a.downcast_mut::() { + if let Some(tb) = a.downcast_mut::() { tb.track_list = Some(list.id); tb.index = index as i32; } diff --git a/crates/oaktimeline/src/undopointer.rs b/crates/oak-timeline/src/undopointer.rs similarity index 99% rename from crates/oaktimeline/src/undopointer.rs rename to crates/oak-timeline/src/undopointer.rs index 5bad75139..dc63f3691 100644 --- a/crates/oaktimeline/src/undopointer.rs +++ b/crates/oak-timeline/src/undopointer.rs @@ -20,11 +20,11 @@ //! //! Graph mutation routes directly through the oaknode Rust domain (the //! oaknode C ABI was deleted in the single-lib unification); command -//! wrapping through `oakundo::undocommand::UndoCommand` values. +//! wrapping through `oak_undo::undocommand::UndoCommand` values. -use oakcore_rs::{Rational, TimeRange}; -use oaknode::graph::NodeEntry; -use oakundo::undocommand::UndoCommand; +use oak_core::{Rational, TimeRange}; +use oak_node::graph::NodeEntry; +use oak_undo::undocommand::UndoCommand; use crate::common::MovementMode; use crate::undocommon::{ diff --git a/crates/oaktimeline/src/undoripple.rs b/crates/oak-timeline/src/undoripple.rs similarity index 99% rename from crates/oaktimeline/src/undoripple.rs rename to crates/oak-timeline/src/undoripple.rs index 28717959c..23a1a1c65 100644 --- a/crates/oaktimeline/src/undoripple.rs +++ b/crates/oak-timeline/src/undoripple.rs @@ -19,7 +19,7 @@ //! //! Graph mutation routes directly through the oaknode Rust domain (the //! oaknode C ABI was deleted in the single-lib unification); command -//! wrapping through `oakundo::undocommand::UndoCommand` values. The C++ +//! wrapping through `oak_undo::undocommand::UndoCommand` values. The C++ //! `std::map<..., TrackHandleLess>` containers are modelled as //! order-preserving `Vec<(NodeRef, _)>` pairs; order follows the track //! `NodeId`, matching `TrackHandleLess`. @@ -30,9 +30,9 @@ //! the thin private helpers below (each annotated with its `// CPP-PARITY` //! source line). -use oakcore_rs::{Rational, TimeRange}; -use oaknode::graph::NodeEntry; -use oakundo::undocommand::UndoCommand; +use oak_core::{Rational, TimeRange}; +use oak_node::graph::NodeEntry; +use oak_undo::undocommand::UndoCommand; use crate::common::MovementMode; use crate::undocommon::{ @@ -105,9 +105,9 @@ fn track_is_locked(track: &NodeRef) -> bool { fn sequence_track_lists(timeline: &NodeRef) -> Vec { let mut lists = Vec::new(); for kind in [ - oaknode::track::TrackType::Video, - oaknode::track::TrackType::Audio, - oaknode::track::TrackType::Subtitle, + oak_node::track::TrackType::Video, + oak_node::track::TrackType::Audio, + oak_node::track::TrackType::Subtitle, ] { if let Some(list) = sequence_track_list(timeline, kind) { lists.push(list); diff --git a/crates/oaktimeline/src/undosplit.rs b/crates/oak-timeline/src/undosplit.rs similarity index 98% rename from crates/oaktimeline/src/undosplit.rs rename to crates/oak-timeline/src/undosplit.rs index 1b9174b62..751775414 100644 --- a/crates/oaktimeline/src/undosplit.rs +++ b/crates/oak-timeline/src/undosplit.rs @@ -29,10 +29,10 @@ //! transition/cache/reconnect steps have no Rust equivalent yet and are //! noted at each site. -use oakcore_rs::Rational; -use oaknode::graph::NodeEntry; -use oaknode::id::NodeId; -use oakundo::undocommand::UndoCommand; +use oak_core::Rational; +use oak_node::graph::NodeEntry; +use oak_node::id::NodeId; +use oak_undo::undocommand::UndoCommand; use crate::util::{ block_in, block_length, block_out, block_set_length_and_media_in, @@ -438,7 +438,7 @@ impl TrackSplitAtTimeCommand { p.graph .get(self.track.id) .and_then(|e| e.behavior.as_any()) - .and_then(|a| a.downcast_ref::()) + .and_then(|a| a.downcast_ref::()) .and_then(|t| { t.block_containing_time(self.point, &GraphBlockRange { graph: &p.graph }) }) diff --git a/crates/oaktimeline/src/undotrack.rs b/crates/oak-timeline/src/undotrack.rs similarity index 99% rename from crates/oaktimeline/src/undotrack.rs rename to crates/oak-timeline/src/undotrack.rs index 83e810585..b0dadc512 100644 --- a/crates/oaktimeline/src/undotrack.rs +++ b/crates/oak-timeline/src/undotrack.rs @@ -19,7 +19,7 @@ //! ([`crate::util::NodeRef`] + the project graph) since the single-lib //! unification removed the oaknode C ABI. -use oakundo::undocommand::UndoCommand; +use oak_undo::undocommand::UndoCommand; use crate::undocommon::{box_command, Command}; use crate::util::{ diff --git a/crates/oaktimeline/src/util.rs b/crates/oak-timeline/src/util.rs similarity index 96% rename from crates/oaktimeline/src/util.rs rename to crates/oak-timeline/src/util.rs index db5dd00ec..59473ce8e 100644 --- a/crates/oaktimeline/src/util.rs +++ b/crates/oak-timeline/src/util.rs @@ -19,27 +19,27 @@ //! //! Since the single-lib unification the oaknode C ABI is gone; every query //! below operates directly on the oaknode Rust domain. A [`NodeRef`] pins a -//! `NodeId` inside a project's graph (`Arc>`), +//! `NodeId` inside a project's graph (`Arc>`), //! replacing the opaque `CHandle` node/block/track references. Nullable //! references are plain `Option` — the old `CHandle::null()` //! sentinel is `None`, and identity (`same_*`) is `NodeId` equality. //! //! Blocks/tracks that a command detaches from the project graph are stored -//! as an owned [`oaknode::graph::NodeEntry`] on the command itself: +//! as an owned [`oak_node::graph::NodeEntry`] on the command itself: //! [`block_remove_from_graph`] takes the entry out of the arena (identity is //! preserved for re-insertion) and [`block_add_to_graph`] puts it back — the //! Rust equivalent of the C++ `setParent(&memory_manager_)` re-homing. use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::Rational; -use oaknode::block::{BlockCore, ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; -use oaknode::graph::{Graph, NodeEntry}; -use oaknode::id::NodeId; -use oaknode::node::NodeCore; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_core::Rational; +use oak_node::block::{BlockCore, ClipBlockBehavior, GapBlockBehavior, TransitionBlockBehavior}; +use oak_node::graph::{Graph, NodeEntry}; +use oak_node::id::NodeId; +use oak_node::node::NodeCore; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; /// A reference to a node — block, track, track list or sequence — inside /// a project's graph. `Clone` is cheap: the project `Arc` is shared and @@ -193,7 +193,7 @@ fn sequence_behavior_of(project: &Project, id: NodeId) -> Option<&SequenceBehavi }) } -/// Graph-backed [`oaknode::track::BlockRange`] view: the block span +/// Graph-backed [`oak_node::track::BlockRange`] view: the block span /// queries the track needs (in/out), read from the `BlockCore`s in the /// arena. pub struct GraphBlockRange<'a> { @@ -201,7 +201,7 @@ pub struct GraphBlockRange<'a> { pub graph: &'a Graph, } -impl oaknode::track::BlockRange for GraphBlockRange<'_> { +impl oak_node::track::BlockRange for GraphBlockRange<'_> { fn in_(&self, block: NodeId) -> Rational { self.graph .get(block) @@ -587,7 +587,7 @@ pub fn block_remove_from_graph(block: &NodeRef) -> Option { /// C++ `oaknode_block_clip_create`: a fresh clip block node in the given /// project's graph. pub fn block_clip_create(project: &Arc>) -> NodeRef { - let (core, behavior) = oaknode::block::clip_create(); + let (core, behavior) = oak_node::block::clip_create(); let id = { let mut p = project .lock() @@ -600,7 +600,7 @@ pub fn block_clip_create(project: &Arc>) -> NodeRef { /// C++ `oaknode_block_gap_create`: a fresh gap block node in the given /// project's graph. pub fn block_gap_create(project: &Arc>) -> NodeRef { - let (core, behavior) = oaknode::block::gap_create(); + let (core, behavior) = oak_node::block::gap_create(); let id = { let mut p = project .lock() diff --git a/crates/oaktimeline/src/workarea.rs b/crates/oak-timeline/src/workarea.rs similarity index 99% rename from crates/oaktimeline/src/workarea.rs rename to crates/oak-timeline/src/workarea.rs index a535936d3..597b5b95d 100644 --- a/crates/oaktimeline/src/workarea.rs +++ b/crates/oak-timeline/src/workarea.rs @@ -23,8 +23,8 @@ use std::sync::{Arc, Mutex}; -use oakcore_rs::{Rational, TimeRange}; -use oakundo::undocommand::UndoCommand; +use oak_core::{Rational, TimeRange}; +use oak_undo::undocommand::UndoCommand; use crate::handle::get; diff --git a/crates/oaktimeline/tests/domain_test.rs b/crates/oak-timeline/tests/domain_test.rs similarity index 95% rename from crates/oaktimeline/tests/domain_test.rs rename to crates/oak-timeline/tests/domain_test.rs index 98bea6219..a93f4bbec 100644 --- a/crates/oaktimeline/tests/domain_test.rs +++ b/crates/oak-timeline/tests/domain_test.rs @@ -15,7 +15,7 @@ // along with this program. If not, see . //! Contract tests for the single-lib domain commands: the undo commands -//! drive a real oaknode project graph through `oaktimeline::util::NodeRef` +//! drive a real oaknode project graph through `oak_timeline::util::NodeRef` //! (the CHandle-based bridge signatures left with the deleted C ABI). //! //! Each test builds a project with a sequence/track-list/track, applies a @@ -24,20 +24,20 @@ use std::sync::{Arc, Mutex}; -use oakcore_rs::{Rational, TimeRange}; -use oaknode::block::{ClipBlockBehavior, GapBlockBehavior}; -use oaknode::project::Project; -use oaknode::sequence::SequenceBehavior; -use oaknode::track::{TrackBehavior, TrackListBehavior, TrackType}; -use oaktimeline::undocommon::Command; -use oaktimeline::undogeneral::{ +use oak_core::{Rational, TimeRange}; +use oak_node::block::{ClipBlockBehavior, GapBlockBehavior}; +use oak_node::project::Project; +use oak_node::sequence::SequenceBehavior; +use oak_node::track::{TrackBehavior, TrackListBehavior, TrackType}; +use oak_timeline::undocommon::Command; +use oak_timeline::undogeneral::{ BlockResizeCommand, TimelineAddTrackCommand, TimelineRemoveTrackCommand, TrackReplaceBlockWithGapCommand, }; -use oaktimeline::undopointer::TrackMoveBlockCommand; -use oaktimeline::undoripple::TrackRippleRemoveAreaCommand; -use oaktimeline::undosplit::BlockSplitCommand; -use oaktimeline::util::{ +use oak_timeline::undopointer::TrackMoveBlockCommand; +use oak_timeline::undoripple::TrackRippleRemoveAreaCommand; +use oak_timeline::undosplit::BlockSplitCommand; +use oak_timeline::util::{ block_clip_create, block_gap_create, block_in, block_length, block_out, block_track, track_append_block, track_block_at, track_block_count, track_length, track_ripple_remove_block, tracklist_track_count, NodeRef, @@ -417,7 +417,7 @@ fn place_block_splice_round_trip() { let placed = add_clip(&track, Rational::new(25, 1), Rational::new(35, 1)); track_ripple_remove_block(&track, &placed); - let mut cmd = oaktimeline::undopointer::TrackPlaceBlockCommand::new( + let mut cmd = oak_timeline::undopointer::TrackPlaceBlockCommand::new( list.clone(), 0, placed.clone(), @@ -453,7 +453,7 @@ fn insert_gaps_round_trip() { let clip = add_clip(&track, Rational::new(0, 1), Rational::new(100, 1)); let mut cmd = - oaktimeline::undogeneral::TrackListInsertGaps::new( + oak_timeline::undogeneral::TrackListInsertGaps::new( list.clone(), Rational::new(40, 1), Rational::new(20, 1), diff --git a/crates/oaktimeline/tests/handle_test.rs b/crates/oak-timeline/tests/handle_test.rs similarity index 97% rename from crates/oaktimeline/tests/handle_test.rs rename to crates/oak-timeline/tests/handle_test.rs index 79aa79467..6f0012f87 100644 --- a/crates/oaktimeline/tests/handle_test.rs +++ b/crates/oak-timeline/tests/handle_test.rs @@ -25,8 +25,8 @@ use std::sync::{Arc, Mutex}; -use oaktimeline::error::OAKTIMELINE_ABI_VERSION; -use oaktimeline::handle::{get, make_owned, CHandle}; +use oak_timeline::error::OAKTIMELINE_ABI_VERSION; +use oak_timeline::handle::{get, make_owned, CHandle}; /// `CHandle::null()` is the all-null sentinel with abi_version 0. #[test] diff --git a/crates/oaktimeline/tests/marker_test.rs b/crates/oak-timeline/tests/marker_test.rs similarity index 98% rename from crates/oaktimeline/tests/marker_test.rs rename to crates/oak-timeline/tests/marker_test.rs index cd585f90d..490b86e1e 100644 --- a/crates/oaktimeline/tests/marker_test.rs +++ b/crates/oak-timeline/tests/marker_test.rs @@ -23,14 +23,14 @@ use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::{Rational, TimeRange}; -use oaktimeline::common::EditToInfo; -use oaktimeline::handle::{get, make_owned, CHandle}; -use oaktimeline::marker::{ +use oak_core::{Rational, TimeRange}; +use oak_timeline::common::EditToInfo; +use oak_timeline::handle::{get, make_owned, CHandle}; +use oak_timeline::marker::{ MarkerAddCommand, MarkerChangeColorCommand, MarkerChangeNameCommand, MarkerChangeTimeCommand, MarkerRemoveCommand, TimelineMarker, TimelineMarkerList, }; -use oaktimeline::undocommon::Command; +use oak_timeline::undocommon::Command; /// Lock the shared marker list behind a live handle. Every marker-list /// handle in these tests comes from `make_owned`, which boxes an diff --git a/crates/oaktimeline/tests/workarea_test.rs b/crates/oak-timeline/tests/workarea_test.rs similarity index 97% rename from crates/oaktimeline/tests/workarea_test.rs rename to crates/oak-timeline/tests/workarea_test.rs index 73b89dafb..f35e2559c 100644 --- a/crates/oaktimeline/tests/workarea_test.rs +++ b/crates/oak-timeline/tests/workarea_test.rs @@ -21,10 +21,10 @@ use std::sync::{Arc, Mutex, MutexGuard}; -use oakcore_rs::{Rational, TimeRange}; -use oaktimeline::handle::{get, make_owned, CHandle}; -use oaktimeline::undocommon::Command; -use oaktimeline::workarea::{ +use oak_core::{Rational, TimeRange}; +use oak_timeline::handle::{get, make_owned, CHandle}; +use oak_timeline::undocommon::Command; +use oak_timeline::workarea::{ reset_in, reset_out, TimelineWorkArea, WorkareaSetEnabledCommand, WorkareaSetRangeCommand, }; diff --git a/crates/oakundo/Cargo.lock b/crates/oak-undo/Cargo.lock similarity index 100% rename from crates/oakundo/Cargo.lock rename to crates/oak-undo/Cargo.lock diff --git a/crates/oakundo/Cargo.toml b/crates/oak-undo/Cargo.toml similarity index 80% rename from crates/oakundo/Cargo.toml rename to crates/oak-undo/Cargo.toml index 9f4e86867..1e047d7f1 100644 --- a/crates/oakundo/Cargo.toml +++ b/crates/oak-undo/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "oakundo" -version = "0.1.0" +name = "oak-undo" +version.workspace = true edition = "2021" description = "Oak Video Editor undo/redo history module (Rust)" license = "GPL-3.0-or-later" diff --git a/crates/oakundo/README.md b/crates/oak-undo/README.md similarity index 100% rename from crates/oakundo/README.md rename to crates/oak-undo/README.md diff --git a/crates/oakundo/src/error.rs b/crates/oak-undo/src/error.rs similarity index 100% rename from crates/oakundo/src/error.rs rename to crates/oak-undo/src/error.rs diff --git a/crates/oakundo/src/global.rs b/crates/oak-undo/src/global.rs similarity index 100% rename from crates/oakundo/src/global.rs rename to crates/oak-undo/src/global.rs diff --git a/crates/oakundo/src/lib.rs b/crates/oak-undo/src/lib.rs similarity index 100% rename from crates/oakundo/src/lib.rs rename to crates/oak-undo/src/lib.rs diff --git a/crates/oakundo/src/undocommand.rs b/crates/oak-undo/src/undocommand.rs similarity index 100% rename from crates/oakundo/src/undocommand.rs rename to crates/oak-undo/src/undocommand.rs diff --git a/crates/oakundo/src/undostack.rs b/crates/oak-undo/src/undostack.rs similarity index 100% rename from crates/oakundo/src/undostack.rs rename to crates/oak-undo/src/undostack.rs diff --git a/crates/oakundo/tests/edge_coverage_test.rs b/crates/oak-undo/tests/edge_coverage_test.rs similarity index 93% rename from crates/oakundo/tests/edge_coverage_test.rs rename to crates/oak-undo/tests/edge_coverage_test.rs index 0f802d10e..0660f6ded 100644 --- a/crates/oakundo/tests/edge_coverage_test.rs +++ b/crates/oak-undo/tests/edge_coverage_test.rs @@ -20,9 +20,9 @@ //! (the former handle-level/refcount tests were removed together with //! the `CHandle` layer they exercised). -use oakundo::error::{Error, OAKUNDO_E_FAILED, OAKUNDO_E_INVALID, OAKUNDO_E_NOMEM, OAKUNDO_E_NOT_FOUND, OAKUNDO_E_STATE}; -use oakundo::undocommand::{MultiUndoCommand, UndoCommand}; -use oakundo::undostack::{EmptyCommand, UndoStack, K_MAX_UNDO_COMMANDS}; +use oak_undo::error::{Error, OAKUNDO_E_FAILED, OAKUNDO_E_INVALID, OAKUNDO_E_NOMEM, OAKUNDO_E_NOT_FOUND, OAKUNDO_E_STATE}; +use oak_undo::undocommand::{MultiUndoCommand, UndoCommand}; +use oak_undo::undostack::{EmptyCommand, UndoStack, K_MAX_UNDO_COMMANDS}; /// Every `Error` variant maps to its documented public code. #[test] diff --git a/crates/oakundo/tests/undo_safe_test.rs b/crates/oak-undo/tests/undo_safe_test.rs similarity index 98% rename from crates/oakundo/tests/undo_safe_test.rs rename to crates/oak-undo/tests/undo_safe_test.rs index ad6eb8ff0..36967cfa5 100644 --- a/crates/oakundo/tests/undo_safe_test.rs +++ b/crates/oak-undo/tests/undo_safe_test.rs @@ -19,9 +19,9 @@ use std::sync::{Arc, Mutex}; -use oakundo::error::Error; -use oakundo::undocommand::UndoCommand; -use oakundo::undostack::{EmptyCommand, UndoStack, K_MAX_UNDO_COMMANDS}; +use oak_undo::error::Error; +use oak_undo::undocommand::UndoCommand; +use oak_undo::undostack::{EmptyCommand, UndoStack, K_MAX_UNDO_COMMANDS}; /// Shared event recorder; commands record `redo:` / `undo:` /// through their closures. diff --git a/crates/oak-worker/Cargo.toml b/crates/oak-worker/Cargo.toml index 9c1deb93e..6437cfd82 100644 --- a/crates/oak-worker/Cargo.toml +++ b/crates/oak-worker/Cargo.toml @@ -16,7 +16,7 @@ [package] name = "oak-worker" -version = "0.1.0" +version.workspace = true edition = "2021" description = "Oak Video Editor headless render worker process (Rust)" license = "GPL-3.0-or-later" @@ -40,9 +40,9 @@ libc = "0.2" # (oakplugin::node_factory::install_render_executor wires the CPU render # executor). oakcodec/ocio-rs/ffmpeg arrive transitively through # oaknode/oakplugin — the same single-lib unification the engine uses. -oakcore-rs = { path = "../oakcore" } -oaknode = { path = "../oaknode" } -oakplugin = { path = "../oakplugin" } +oak-core = { path = "../oak-core" } +oak-node = { path = "../oak-node" } +oak-plugin = { path = "../oak-plugin" } # M14 R2 / M15 S1: oak-worker is a PURE module-crate consumer — the # worker runtime (src/worker.rs) lives in this binary and calls the oak* @@ -50,4 +50,4 @@ oakplugin = { path = "../oakplugin" } # evaluation path and the shared ipc protocol (src/ipc.rs is a shim # re-exporting oakrender::ipc). No liboakengine dylib, no C ABI, no # build.rs link step. -oakrender = { path = "../oakrender" } +oak-render = { path = "../oak-render" } diff --git a/crates/oak-worker/src/ipc.rs b/crates/oak-worker/src/ipc.rs index fa78ef7b7..1ea3d7212 100644 --- a/crates/oak-worker/src/ipc.rs +++ b/crates/oak-worker/src/ipc.rs @@ -16,10 +16,10 @@ //! Render-worker IPC shim (M15 S1): the NDJSON protocol and the //! shared-memory frame-slot transport now live in the oakrender crate -//! (`oakrender::ipc`) so both ends of the pipe link one copy — the +//! (`oak_render::ipc`) so both ends of the pipe link one copy — the //! main-process dispatcher creates the segments and the worker attaches //! to them. This module re-exports the whole surface, keeping the //! worker-side `crate::ipc::` paths unchanged. The facade (oakengine) //! still keeps its own copy for the frozen `oakengine_ipc_*` C ABI. -pub use oakrender::ipc::*; +pub use oak_render::ipc::*; diff --git a/crates/oak-worker/src/worker.rs b/crates/oak-worker/src/worker.rs index e40335d6c..49f0d46d2 100644 --- a/crates/oak-worker/src/worker.rs +++ b/crates/oak-worker/src/worker.rs @@ -21,7 +21,7 @@ //! //! - **Backend selection.** [`Renderer::create`] initializes the render //! backend through the oakrender crate's direct Rust API -//! ([`oakrender::backend::DisplayRenderer`]), falling back to the +//! ([`oak_render::backend::DisplayRenderer`]), falling back to the //! direct OpenGL renderer exactly like the C++ `create_renderer()` //! chain. The headless `"cpu"` backend (M15 S1) skips the renderer //! entirely — the render path is CPU evaluation + decode, driven @@ -38,7 +38,7 @@ //! Real rendering landed in M15 S1: `load_graph` deserializes the graph //! snapshot file (oaknode project XML, with the minimal //! `{"project_copy":N}` payload fallback); `render_frame` and -//! `render_batch` render through [`oakrender::eval`] (generated frames, +//! `render_batch` render through [`oak_render::eval`] (generated frames, //! footage decode, montage compositing) directly into the main-assigned //! shm slots and publish `frame_ready` / `frame_failed` (protocol v2). @@ -49,10 +49,10 @@ use std::time::{Duration, Instant}; use serde_json::{json, Value}; -use oakcore_rs::{PixelFormat, Rational}; -use oakrender::backend::{BackendKind, DisplayRenderer}; -use oakrender::eval; -use oakrender::ticket::{AudioTicketParams, MontageClip, VideoTicketParams}; +use oak_core::{PixelFormat, Rational}; +use oak_render::backend::{BackendKind, DisplayRenderer}; +use oak_render::eval; +use oak_render::ticket::{AudioTicketParams, MontageClip, VideoTicketParams}; use crate::ipc::{ error_message, write_message, AudioTicketSpec, BatchTicketSpec, FrameSlotPool, FrameSlotMeta, @@ -66,7 +66,7 @@ use crate::{log_error, PROTOCOL_VERSION}; /// A loaded graph snapshot (M15 S1): the snapshot file path plus what it /// deserialized into — a full oaknode project, or only the copied-project /// identity (the minimal `{"project_copy":N}` payload the -/// [`oakrender::worker::GraphSnapshotStore`] writes before the app wires +/// [`oak_render::worker::GraphSnapshotStore`] writes before the app wires /// full graph uploads in S2). struct LoadedGraph { /// Snapshot file path (S2: graph_update diffing is path-based). @@ -75,7 +75,7 @@ struct LoadedGraph { /// The deserialized project (S2: node-graph render path; today only /// montage/footage/generate tickets use the loaded context). #[allow(dead_code)] - project: Option>>, + project: Option>>, project_copy: u64, } @@ -146,7 +146,7 @@ struct WorkerProgressReporter { message: String, } -impl oakplugin::progress::UiProgressReporter for WorkerProgressReporter { +impl oak_plugin::progress::UiProgressReporter for WorkerProgressReporter { fn update(&mut self, progress: f64) -> bool { push_worker_progress(progress, &self.label, &self.message); !WORKER_PLUGIN_CANCEL.load(Ordering::Relaxed) @@ -163,7 +163,7 @@ impl oakplugin::progress::UiProgressReporter for WorkerProgressReporter { /// [`WorkerSession::initialize_runtime`]; mirrors the main-process factory /// (a fresh progressStart resets the sticky cancel flag). fn install_worker_progress_factory() { - oakplugin::progress::set_reporter_factory(Some(Arc::new(|label, message| { + oak_plugin::progress::set_reporter_factory(Some(Arc::new(|label, message| { // A fresh render begins: reset the sticky cancel flag. WORKER_PLUGIN_CANCEL.store(false, Ordering::Relaxed); push_worker_progress(0.0, label, message); @@ -186,7 +186,7 @@ pub fn is_no_backend(backend: &str) -> bool { /// Whether `backend` is the M15 headless CPU render mode: like "none" /// (no GPU renderer) but the session stays fully operational — frames -/// render through the CPU evaluation path ([`oakrender::eval`]). +/// render through the CPU evaluation path ([`oak_render::eval`]). pub fn is_cpu_backend(backend: &str) -> bool { backend.eq_ignore_ascii_case("cpu") } @@ -280,7 +280,7 @@ impl WorkerSession { /// creation, anything else initializes the render backend through the /// oakrender crate's direct Rust API (dynamic -> OpenGL fallback). /// The M15 `"cpu"` backend is the headless render mode: no renderer, - /// CPU evaluation + decode via [`oakrender::eval`]. + /// CPU evaluation + decode via [`oak_render::eval`]. pub fn create(backend: &str) -> Result { let renderer = if is_no_backend(backend) || is_cpu_backend(backend) { None @@ -321,7 +321,7 @@ impl WorkerSession { return true; } log_error("runtime: loading color-manager default config"); - if let Err(e) = oakrender::color::set_up_default_config() { + if let Err(e) = oak_render::color::set_up_default_config() { log_error(&format!( "runtime: color-manager default config failed ({e}); continuing" )); @@ -331,17 +331,17 @@ impl WorkerSession { // §3.6). oakplugin installs its render driver into the oakrender // executor slot. log_error("runtime: installing oakplugin render executor"); - oakplugin::node_factory::install_render_executor(); + oak_plugin::node_factory::install_render_executor(); // M15 S2: graphs carrying OFX plugin nodes deserialize/evaluate in // the worker too, so the per-process node factory must register the // discovered plugins exactly like the main process. A failed scan is // non-fatal: the worker stays up for plugin-free graphs. log_error("runtime: scanning and registering OFX plugins"); - if let Err(e) = oakplugin::host::Host::global().cache.scan() { + if let Err(e) = oak_plugin::host::Host::global().cache.scan() { log_error(&format!("runtime: OFX plugin scan failed ({e}); continuing")); } - let discovered = oakplugin::host::Host::global().cache.count(); - let registered = oakplugin::node_factory::register_plugin_nodes(); + let discovered = oak_plugin::host::Host::global().cache.count(); + let registered = oak_plugin::node_factory::register_plugin_nodes(); log_error(&format!( "runtime: discovered {} OFX plugin(s), registered {} node type(s)", discovered, @@ -509,7 +509,7 @@ impl WorkerSession { /// `load_graph` (M15 S1): the file checks mirror worker.cpp; the /// payload is deserialized for real — an oaknode project XML - /// ([`oaknode::serializer::load`]) or the minimal + /// ([`oak_node::serializer::load`]) or the minimal /// `{"project_copy":N}` identity payload written by the snapshot /// store before full graph uploads land in S2. Success answers /// nothing (v1 semantics); failures answer an `error` message. @@ -542,7 +542,7 @@ impl WorkerSession { )) } }; - match oaknode::serializer::load(&content) { + match oak_node::serializer::load(&content) { Ok(project) => { self.graph = Some(LoadedGraph { path: load.path.clone(), @@ -579,7 +579,7 @@ impl WorkerSession { } /// `render_frame` (v1 single-frame path, M15 S1 real): generate the - /// frame through [`oakrender::eval`], write it into an acquired shm + /// frame through [`oak_render::eval`], write it into an acquired shm /// slot and answer `frame_ready`. The v1 message carries no montage /// or footage fields, so this path renders the pipeline's generated /// frame; montage/footage tickets arrive via `render_batch`. @@ -601,8 +601,8 @@ impl WorkerSession { (render.width, render.height) } else { ( - oakrender::frame::VideoParamsPod::DEFAULT_WIDTH, - oakrender::frame::VideoParamsPod::DEFAULT_HEIGHT, + oak_render::frame::VideoParamsPod::DEFAULT_WIDTH, + oak_render::frame::VideoParamsPod::DEFAULT_HEIGHT, ) }; let format = if render.format < 0 { @@ -983,7 +983,7 @@ impl WorkerSession { .as_ref() .map(|g| g.project_copy) .unwrap_or(0), - range: oakcore_rs::TimeRange::new(start, start + duration), + range: oak_core::TimeRange::new(start, start + duration), sample_rate: spec.sample_rate, channel_layout: spec.channel_layout, montage, @@ -1092,7 +1092,7 @@ impl WorkerSession { /// Render the F32 RGBA pipeline frame for `spec` into `dst` /// (`(w*h*16)` bytes): generated transparent black, footage decode, -/// or montage composite — through [`oakrender::eval`]. +/// or montage composite — through [`oak_render::eval`]. fn render_f32_into( spec: &BatchTicketSpec, params: &VideoTicketParams, @@ -1115,7 +1115,7 @@ fn render_f32_into( PixelFormat::F32, ) .map_err(|e| format!("footage decode: {e}"))?; - let oakrender::texture::Texture::Cpu(frame) = &decoded else { + let oak_render::texture::Texture::Cpu(frame) = &decoded else { return Err("decode produced a GPU texture".to_string()); }; let src_stride = frame.linesize_bytes() as usize; @@ -1574,8 +1574,8 @@ mod tests { let _ = std::fs::remove_file(&empty); // A real oaknode project round-trips through the serializer. - let project = oaknode::project::Project::new(); - let xml = oaknode::serializer::save(&project.lock().unwrap_or_else(|e| e.into_inner())) + let project = oak_node::project::Project::new(); + let xml = oak_node::serializer::save(&project.lock().unwrap_or_else(|e| e.into_inner())) .expect("serialize empty project"); let real = std::env::temp_dir().join("oak_worker_main_test_graph.ove"); std::fs::write(&real, &xml).unwrap(); diff --git a/crates/oak-worker/tests/procpool_integration.rs b/crates/oak-worker/tests/procpool_integration.rs index c1f8185a8..605d8c595 100644 --- a/crates/oak-worker/tests/procpool_integration.rs +++ b/crates/oak-worker/tests/procpool_integration.rs @@ -30,15 +30,15 @@ use std::sync::{Arc, Mutex}; use std::time::{Duration, Instant}; -use oakcore_rs::{PixelFormat, Rational, TimeRange}; -use oakrender::ipc::SLOT_FORMAT_BGRA8; -use oakrender::procpool::{ +use oak_core::{PixelFormat, Rational, TimeRange}; +use oak_render::ipc::SLOT_FORMAT_BGRA8; +use oak_render::procpool::{ main_heap_frame_copies, reset_main_heap_frame_copies, DispatcherConfig, ProcessDispatcher, }; -use oakrender::ticket::{ +use oak_render::ticket::{ AudioTicketParams, TicketPayload, TicketResult, VideoTicketParams, }; -use oakrender::worker::{Job, JobDispatch, JobSchedule}; +use oak_render::worker::{Job, JobDispatch, JobSchedule}; /// Serialize every test in this file (shared process environment + /// real child processes). @@ -103,7 +103,7 @@ fn submit( // Never invoked on the process backend (workers render from // the wire spec); must still be a valid producer. produce: Arc::new(|_, _| { - Err(oakrender::error::Error::Failed( + Err(oak_render::error::Error::Failed( "process backend does not use the in-process producer".into(), )) }), @@ -359,7 +359,7 @@ fn submit_audio( // Never invoked on the process backend (the worker renders audio // from the wire spec); must still be a valid producer. produce: Arc::new(|_, _| { - Err(oakrender::error::Error::Failed( + Err(oak_render::error::Error::Failed( "process backend does not use the in-process producer".into(), )) }), @@ -399,7 +399,7 @@ fn audio_tickets_roundtrip_through_shm_slots() { }; assert_eq!(audio.sample_rate, 48000); assert_eq!(audio.channel_count, 2); - assert_eq!(audio.meta.format, oakrender::ipc::SLOT_FORMAT_AUDIO_F32); + assert_eq!(audio.meta.format, oak_render::ipc::SLOT_FORMAT_AUDIO_F32); assert_eq!(audio.meta.channel_count, 2); assert_eq!(audio.meta.linesize, 2 * 4); assert_eq!(audio.meta.data_size, 2000 * 2 * 4); @@ -573,7 +573,7 @@ fn oversized_audio_ticket_is_refused_by_process_backend() { }), audio: Some(audio), produce: Arc::new(|_, _| { - Err(oakrender::error::Error::Failed( + Err(oak_render::error::Error::Failed( "process backend does not use the in-process producer".into(), )) }), @@ -634,7 +634,7 @@ fn f32_ticket_gets_f32_slot_and_bgra8_stays_bgra8() { }), audio: None, produce: Arc::new(|_, _| { - Err(oakrender::error::Error::Failed( + Err(oak_render::error::Error::Failed( "process backend does not use the in-process producer".into(), )) }), diff --git a/docs/build.md b/docs/build.md index 07478d984..1de0cbfc3 100644 --- a/docs/build.md +++ b/docs/build.md @@ -33,7 +33,7 @@ macOS, Linux, and Windows. For the Chinese version see `FFMPEG_DIR` does not need exporting: the committed `.cargo/config.toml` sets it relative to the workspace root (`ffmpeg-sys-next` cannot read `.env` at build-script time — the - config entry is the only machine-agnostic way). The `oakffmpeg-link` + config entry is the only machine-agnostic way). The `oak-ffmpeg-link` build script panics without it; run `build-ffmpeg.sh` once before the first `cargo build`. @@ -128,7 +128,7 @@ Unix-style link args the MSVC linker rejects). Without the `bundled` feature and without `OCIO_RS_ENABLE_REAL=1`, `ocio-sys` builds a stub and every colour test early-returns. The -bundled feature is enabled unconditionally by `oakrender`, so a plain +bundled feature is enabled unconditionally by `oak-render`, so a plain `cargo build` always gets the real thing on Linux/macOS. ## Packaging @@ -149,7 +149,7 @@ libraries; see `docs/project-storage.md` for what lands where. ## Troubleshooting -- **`oakffmpeg-link` panics about `FFMPEG_DIR`** — run +- **`oak-ffmpeg-link` panics about `FFMPEG_DIR`** — run `tooling/ffmpeg/build-ffmpeg.sh` once; it installs into `.cache/ffmpeg`, which `.cargo/config.toml` points at. - **IDE builds fail (RustRover etc.)** — IDEs that cannot inject diff --git a/docs/project-storage.md b/docs/project-storage.md index 7578b0ce4..cc56ed92b 100644 --- a/docs/project-storage.md +++ b/docs/project-storage.md @@ -18,7 +18,7 @@ not the working store. "the node graph plus settings" — nothing else — so node granularity is a closed, complete model. - **One serialization truth.** The node XML in the database is the same - document the `.ove` serializer produces (`oaknode::serializer`). + document the `.ove` serializer produces (`oak-node::serializer`). New features (e.g. adjustment layers) extend the XML schema only — the database schema never changes. - **The journal is produced by diffing, not by instrumenting commands.** @@ -65,7 +65,7 @@ sequence ────▶ tracklist ────▶ track ─ The clip row carries its timeline range (``), media offset (``) and footage reference; effect chains are connection records inside the effect nodes' XML. Loading re-links -these identities in two passes (see `oaknode::serializer`), so no +these identities in two passes (see `oak-node::serializer`), so no join tables are needed. Timeline edits map to a handful of node rows: moving a clip touches its track and the clip; splitting adds one node and updates two; ripple edits touch the affected tracks and delete the @@ -85,7 +85,7 @@ removed clips. ## Import / export - Import: `.ove` / `.otio` / `.fcpxml` are parsed by their existing - oakstorage backends and inserted as a new project row with + oak-storage backends and inserted as a new project row with `kind = 'import'` journal entries. - Export: the in-memory serialization is written through the ove-xml or otio backend; nothing is read from or written to the database @@ -118,13 +118,13 @@ database is a single user-level SQLite file; PostgreSQL is selected with `Storage/Backend = "pg"` + `Storage/PgUrl`, or directly with an `oakdb+pg://` URI. -Database tests: `cargo test -p oakstorage` is green without PostgreSQL — +Database tests: `cargo test -p oak-storage` is green without PostgreSQL — the SQLite suite always runs; the PG suite (`tests/database_pg_test.rs`) connects to a real server when `OAK_TEST_PG_URL` is set (e.g. `postgres://user:pass@host:5432/db`) and skips with a note otherwise. The URL should point at a dedicated test database: each test resets the four tables. -See also: [M10 oakstorage manual](plans/riir/M10-oakstorage.md), +See also: [M10 oak-storage manual](plans/riir/M10-oak-storage.md), [M13 write-through plan](plans/riir/M13-storage-live.md), [project file reference](project-file-reference.md). diff --git a/docs/zh/build.md b/docs/zh/build.md index 8a20db082..ff6dcf21d 100644 --- a/docs/zh/build.md +++ b/docs/zh/build.md @@ -31,7 +31,7 @@ ``` `FFMPEG_DIR` 无需手动导出:仓库内提交的 `.cargo/config.toml` 已按 workspace 根的相对路径设置(`ffmpeg-sys-next` 的构建脚本读不了 - `.env`,这是唯一与机器无关的方式)。缺少它时 `oakffmpeg-link` 的 + `.env`,这是唯一与机器无关的方式)。缺少它时 `oak-ffmpeg-link` 的 构建脚本会直接 panic:首次 `cargo build` 前请先跑一次 `build-ffmpeg.sh`。 @@ -125,7 +125,7 @@ Windows 构建目标是 **x86_64-pc-windows-gnu**,使用 MSYS2 自带 Rust; | Windows | MSYS2 `mingw-w64-ucrt-x86_64-opencolorio` | 动态 | 设置 `OCIO_INSTALL_DIR=/ucrt64`、`OCIO_RS_LINK=dynamic` | 既没有 `bundled` 特性也没有 `OCIO_RS_ENABLE_REAL=1` 时,`ocio-sys` -构建为 stub,所有色彩测试直接跳过。`oakrender` 无条件启用 bundled +构建为 stub,所有色彩测试直接跳过。`oak-render` 无条件启用 bundled 特性,因此在 Linux/macOS 上直接 `cargo build` 就会得到真实 OCIO。 ## 打包 @@ -145,7 +145,7 @@ tooling/package/build-pkg.sh # Arch Linux → .pkg.tar.zst ## 故障排查 -- **`oakffmpeg-link` 报 `FFMPEG_DIR` panic** —— 先跑一次 +- **`oak-ffmpeg-link` 报 `FFMPEG_DIR` panic** —— 先跑一次 `tooling/ffmpeg/build-ffmpeg.sh`;它安装到 `.cache/ffmpeg`, `.cargo/config.toml` 已指向该目录。 - **IDE 构建失败(RustRover 等)** —— 无法向 cargo 注入环境变量的 diff --git a/docs/zh/project-storage.md b/docs/zh/project-storage.md index 4f66aec4b..d09d0bad8 100644 --- a/docs/zh/project-storage.md +++ b/docs/zh/project-storage.md @@ -14,7 +14,7 @@ Oak 的工程持久化在**数据库**(默认 SQLite,支持 PostgreSQL), payload 里。工程 = 节点图 + settings,没有第三种东西——节点粒度 因此是封闭全集。 - **单一序列化事实。** 库里的节点 XML 与 .ove 序列化器 - (`oaknode::serializer`)产出的是同一份文档。新功能(比如调整图层) + (`oak-node::serializer`)产出的是同一份文档。新功能(比如调整图层) 只需要扩展 XML schema,数据库 schema 永远不变。 - **journal 由 diff 产生,不靠命令申报。** 每条 undoable 命令成功后, 在内存里重新序列化工程并与上一状态逐节点比对;变化/新增/删除的 @@ -54,7 +54,7 @@ sequence ────▶ tracklist ────▶ track ─ clip 行自带时间线区间(``)、媒体偏移(``) 和素材引用;效果链是效果节点 XML 里的连接记录。加载时两阶段重连 -这些 identity(见 `oaknode::serializer`),所以不需要任何连接表。 +这些 identity(见 `oak-node::serializer`),所以不需要任何连接表。 时间线编辑映射为少数节点行:移动 clip 触及它的 track 和 clip 本身; 分割新增一个节点、更新两个;ripple 编辑触及受影响的 track 并删除 被移除的 clip。 @@ -69,7 +69,7 @@ clip 行自带时间线区间(``)、媒体偏移(`. + +# A standalone cross-crate integration example: renders the full OakApp +# shell offscreen and saves screenshots to docs/. Every example under +# examples/ is its own crate with its own Cargo.toml (see the workspace +# root manifest), so it can depend on oak-app exactly like an external +# consumer would. + +[package] +name = "simple_player" +version = "0.1.0" +edition = "2021" +publish = false +description = "Oak cross-crate integration example: renders the app shell to screenshots" + +[dependencies] +# test-support pulls the visual-test harness (VisualTestAppContext, +# capture_screenshot) the example drives the shell with. +gpui = { path = "../../gpui/crates/gpui", features = ["test-support"] } +gpui_platform = { path = "../../gpui/crates/gpui_platform", features = ["test-support"] } +oak-app = { path = "../../crates/oak-app" } +image = "0.25" diff --git a/examples/screenshot.rs b/examples/simple_player/src/main.rs similarity index 95% rename from examples/screenshot.rs rename to examples/simple_player/src/main.rs index 043747355..4b0308e17 100644 --- a/examples/screenshot.rs +++ b/examples/simple_player/src/main.rs @@ -54,17 +54,17 @@ const DEFAULT_WIDTH: f32 = 1600.0; #[cfg(target_os = "macos")] const DEFAULT_HEIGHT: f32 = 900.0; #[cfg(target_os = "macos")] -const OUT_ZH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/docs/screenshot-window.png"); +const OUT_ZH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/screenshot-window.png"); #[cfg(target_os = "macos")] -const OUT_EN: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/docs/screenshot-window-en.png"); +const OUT_EN: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/screenshot-window-en.png"); #[cfg(target_os = "macos")] -const OUT_MGR_ZH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/docs/screenshot-manager.png"); +const OUT_MGR_ZH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/screenshot-manager.png"); #[cfg(target_os = "macos")] -const OUT_MGR_EN: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/docs/screenshot-manager-en.png"); +const OUT_MGR_EN: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/screenshot-manager-en.png"); #[cfg(target_os = "macos")] -const OUT_PREF_ZH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/docs/screenshot-preferences.png"); +const OUT_PREF_ZH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/screenshot-preferences.png"); #[cfg(target_os = "macos")] -const OUT_PREF_EN: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/docs/screenshot-preferences-en.png"); +const OUT_PREF_EN: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../../docs/screenshot-preferences-en.png"); /// Logical y of the timeline toolbar row, which sits at the top of the /// bottom dock panel in the default layout: the dock starts at y 27.5 (the diff --git a/tooling/ffmpeg/build-ffmpeg.sh b/tooling/ffmpeg/build-ffmpeg.sh index 5827e62da..d226e6793 100755 --- a/tooling/ffmpeg/build-ffmpeg.sh +++ b/tooling/ffmpeg/build-ffmpeg.sh @@ -15,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Builds a project-owned FFmpeg for the oakcodec/oakaudio `ffmpeg-next` +# Builds a project-owned FFmpeg for the oak-codec/oak-audio `ffmpeg-next` # dependency and installs it into .cache/ffmpeg. Point cargo at it with: # # export FFMPEG_DIR="$(pwd)/.cache/ffmpeg" diff --git a/tooling/install-deps.sh b/tooling/install-deps.sh index f05ea36be..22202ab63 100755 --- a/tooling/install-deps.sh +++ b/tooling/install-deps.sh @@ -17,7 +17,7 @@ # Installs the system dependencies of the Oak Rust workspace: # the free-license external codec/filter libraries FFmpeg is configured -# with (see crates/oakcodec/Cargo.toml), plus the build tools. FFmpeg +# with (see crates/oak-codec/Cargo.toml), plus the build tools. FFmpeg # itself is built from source by tooling/ffmpeg/build-ffmpeg.sh (which # installs into .cache/ffmpeg) and is NOT installed here. #