diff --git a/Cargo.lock b/Cargo.lock index 675956ce8..8d138bb49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4158,9 +4158,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" dependencies = [ "serde_core", "value-bag", @@ -4732,7 +4732,6 @@ dependencies = [ "log", "oak-audio", "oak-codec", - "oak-common", "oak-core", "oak-node", "oak-plugin", @@ -4753,7 +4752,6 @@ dependencies = [ "cpal", "ffmpeg-next", "oak-codec", - "oak-common", "oak-core", "oak-ffmpeg-link", "thiserror 2.0.20", @@ -4765,7 +4763,6 @@ version = "0.5.0" dependencies = [ "clap", "oak-codec", - "oak-common", "oak-core", "oak-node", "oak-render", @@ -4778,29 +4775,24 @@ name = "oak-codec" version = "0.5.0" dependencies = [ "ffmpeg-next", - "oak-common", "oak-core", "oak-ffmpeg-link", "thiserror 2.0.20", ] [[package]] -name = "oak-common" +name = "oak-core" version = "0.5.0" dependencies = [ "image", "log", - "oak-core", "ocio-rs", "quick-xml 0.41.0", "thiserror 2.0.20", "toml 0.8.23", + "wgpu 25.0.2", ] -[[package]] -name = "oak-core" -version = "0.5.0" - [[package]] name = "oak-ffmpeg-link" version = "0.5.0" @@ -4810,7 +4802,6 @@ name = "oak-node" version = "0.5.0" dependencies = [ "oak-codec", - "oak-common", "oak-core", "oak-undo", "thiserror 2.0.20", @@ -4846,7 +4837,6 @@ dependencies = [ "libc", "naga 25.0.1", "oak-codec", - "oak-common", "oak-core", "oak-node", "ocio-rs", @@ -4861,7 +4851,6 @@ name = "oak-storage" version = "0.5.0" dependencies = [ "chrono", - "oak-common", "oak-core", "oak-node", "oak-otio", @@ -4878,7 +4867,6 @@ name = "oak-task" version = "0.5.0" dependencies = [ "oak-codec", - "oak-common", "oak-core", "oak-node", "oak-otio", @@ -4891,7 +4879,6 @@ dependencies = [ name = "oak-timeline" version = "0.5.0" dependencies = [ - "oak-common", "oak-core", "oak-node", "oak-undo", @@ -4911,7 +4898,6 @@ version = "0.5.0" dependencies = [ "libc", "oak-codec", - "oak-common", "oak-core", "oak-node", "oak-plugin", @@ -7566,7 +7552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand 2.5.0", - "getrandom 0.3.4", + "getrandom 0.4.3", "once_cell", "rustix 1.1.4", "windows-sys 0.61.2", diff --git a/crates/oak-app/Cargo.toml b/crates/oak-app/Cargo.toml index be4976242..b3388c418 100644 --- a/crates/oak-app/Cargo.toml +++ b/crates/oak-app/Cargo.toml @@ -76,7 +76,6 @@ log = "0.4" # 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" } diff --git a/crates/oak-app/src/actions.rs b/crates/oak-app/src/actions.rs index bb2d33951..867641745 100644 --- a/crates/oak-app/src/actions.rs +++ b/crates/oak-app/src/actions.rs @@ -481,7 +481,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 = oak_common::filefunctions::FileFunctions::new() + let dir = oak_core::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/crates/oak-app/src/app.rs b/crates/oak-app/src/app.rs index 5ffdf4499..f46091c10 100644 --- a/crates/oak-app/src/app.rs +++ b/crates/oak-app/src/app.rs @@ -42,13 +42,13 @@ use std::time::Duration; use crate::oakui::component::menu::{self, Menu, MenuBar, MenuBarEntry, MenuBarEvent, MenuItem}; use crate::oakui::component::text_input::install_text_input_bindings; use gpui::dock::{ - DockArea, DockEvent, DockLayout, DropTarget, DropZone, NodePath, PanelHandle, PanelId, - PanelRegistry, + DockArea, DockEvent, DockLayout, DropTarget, DropZone, NodePath, PanelHandle, PanelId, + PanelRegistry, }; use gpui::timeline::{ClipData, ClipId, Frame, FrameRange, TimelineEvent, TimelineView, TrackData}; use gpui::{ - colors::DefaultColors, div, prelude::*, px, size, App, AsyncWindowContext, Bounds, Context, - Entity, PathPromptOptions, Render, Window, WindowBounds, WindowOptions, + colors::DefaultColors, div, prelude::*, px, size, App, AsyncWindowContext, Bounds, Context, + Entity, PathPromptOptions, Render, Window, WindowBounds, WindowOptions, }; use gpui_widgets::audio_meter::{AudioLevelMeter, MeterOrientation}; use gpui_widgets::dialog::progress::{progress_dialog, ProgressContent}; @@ -58,7 +58,7 @@ use gpui_widgets::viewer::PlaybackClock; use crate::actions::{ActionId, TimelineToolExt, Tool}; use crate::dialogs::{ - DropSequenceChoice, ExportDialogContent, PreferencesDialogContent, SequenceFormatSeed, + DropSequenceChoice, ExportDialogContent, PreferencesDialogContent, SequenceFormatSeed, }; use crate::oakui::{AppEngine, ExportSession, MockEngine, Monitor, RealEngine}; use crate::panels::commands as panel_commands; @@ -78,9 +78,9 @@ use crate::panels::timeline::{FootageDropNeedsSequence, TimelinePanel}; // registry is the single source; these keep the test call sites readable). #[cfg(test)] pub(crate) mod menu_ids { - use crate::actions::ActionId; + use crate::actions::ActionId; - pub const NEW_PROJECT: usize = ActionId::NewProject.menu_id(); + pub const NEW_PROJECT: usize = ActionId::NewProject.menu_id(); pub const OPEN_PROJECT: usize = ActionId::OpenProject.menu_id(); pub const EXPORT_PROJECT: usize = ActionId::SaveProject.menu_id(); pub const CLOSE: usize = ActionId::CloseProject.menu_id(); @@ -1035,8 +1035,8 @@ impl OakApp { /// preferences, tools, transport fallbacks — and the placeholder /// `println!` for the actions not wired yet. fn handle_global_action(&mut self, action: ActionId, cx: &mut Context) { - use crate::actions::ActionId as A; - match action { + use crate::actions::ActionId as A; + match action { // --- File ------------------------------------------------------ A::NewProject => self.open_new_project(cx), A::OpenProject => self.open_file_dialog(FileAction::Open, cx), @@ -1746,8 +1746,8 @@ impl OakApp { /// close the dialog on success; the mutating actions reload the list; /// failures land in the dialog's status line. fn on_manager_event(&mut self, event: &crate::manager::ManagerEvent, cx: &mut Context) { - use crate::manager::ManagerEvent as E; - match event { + use crate::manager::ManagerEvent as E; + match event { E::Create => { let name = crate::i18n::tr("manager.new.default_name").to_string(); let result = self @@ -3392,7 +3392,7 @@ impl MenuState { loop_playback: false, show_all: false, full_screen: false, - use_proxy_media: oak_common::configstore::ConfigStore::instance().get_bool( + use_proxy_media: oak_core::configstore::ConfigStore::instance().get_bool( None, "UseProxyMedia", 1, @@ -3420,10 +3420,10 @@ fn menu_item(action: ActionId) -> MenuItem { /// the menu bar after a language switch repaints it in the new language; /// `state` drives the dynamic checkmarks (theme, tool, snapping, loop, …). fn make_menus(state: MenuState) -> Vec { - use crate::actions::ActionId as A; - use crate::i18n::tr; + use crate::actions::ActionId as A; + use crate::i18n::tr; - let theme_submenu = Menu::new(vec![ + let theme_submenu = Menu::new(vec![ menu_item(A::ThemeDark).with_checked(state.dark), menu_item(A::ThemeLight).with_checked(!state.dark), ]); @@ -3754,9 +3754,9 @@ fn run_with(args: AppArgs) { // choice through the process environment. Read by gpui_wgpu as // OAK_DISPLAY_BIT_DEPTH ("8" opts into the 8-bit pair; anything // else requests 10-bit). - let bit_depth = oak_render::backend::DisplayBitDepth::from_config_string( + let bit_depth = oak_core::backend::DisplayBitDepth::from_config_string( &crate::oakui::real::config_get_string( - oak_render::backend::CONFIG_KEY_DISPLAY_BIT_DEPTH, + oak_core::backend::CONFIG_KEY_DISPLAY_BIT_DEPTH, ), ); // SAFETY: single-threaded startup, before any window exists. @@ -3830,14 +3830,14 @@ fn run_with(args: AppArgs) { #[cfg(test)] mod tests { - use super::*; - use crate::oakui::EngineGateway as _; - use gpui::timeline::TimelineDataSource as _; - use gpui::{ - px, size, AnyWindowHandle, ExternalPaths, FileDropEvent, TestAppContext, VisualTestContext, - }; + use super::*; + use crate::oakui::EngineGateway as _; + use gpui::timeline::TimelineDataSource as _; + use gpui::{ + px, size, AnyWindowHandle, ExternalPaths, FileDropEvent, TestAppContext, VisualTestContext, + }; - /// The 视图/View menu carries a 语言/Language submenu whose items are + /// The 视图/View menu carries a 语言/Language submenu whose items are /// labeled in their own language and whose checkmark follows the active /// language — and the whole menu bar flips language with `i18n`. #[test] diff --git a/crates/oak-app/src/dialogs.rs b/crates/oak-app/src/dialogs.rs index 29b96c8dc..fbbb5c9da 100644 --- a/crates/oak-app/src/dialogs.rs +++ b/crates/oak-app/src/dialogs.rs @@ -21,7 +21,7 @@ //! Each view owns its widgets and emits nothing itself — the host //! (`crate::app::OakApp`) reads the state (format / path) when a dialog //! button is clicked, and the preferences view writes its choices straight -//! into the oakcommon config store on selection. Theme/language changes +//! into the oak_core config store on selection. Theme/language changes //! additionally emit a [`PreferencesEvent`] so the host can re-apply the //! shell chrome immediately. @@ -36,28 +36,28 @@ use gpui::colors::DefaultColors; use gpui::prelude::*; use gpui::timeline::FrameRate; use gpui::{ - div, px, App, ClickEvent, Context, ElementId, Entity, EventEmitter, FocusHandle, Focusable, - InteractiveElement, Keystroke, PathPromptOptions, Render, SharedString, Window, + div, px, App, ClickEvent, Context, ElementId, Entity, EventEmitter, FocusHandle, Focusable, + InteractiveElement, Keystroke, PathPromptOptions, Render, SharedString, Window, }; use gpui_elements::editable_text::{EditableTextState, StringStorage, TextChanged}; use crate::actions::ActionId; use crate::i18n; use crate::oakui::real::{ - audio_input_device, audio_input_devices, audio_output_device, audio_output_devices, - config_get_bool, config_get_int, config_get_string, config_set_bool, config_set_int, - config_set_string, encoding_formats, proxy_dividers, renderer_backends, set_audio_input_device, - set_audio_output_device, set_theme_dark, theme_is_dark, CONFIG_KEY_DEFAULT_TRANSITION_SEC, - CONFIG_KEY_DISK_CACHE_PATH, CONFIG_KEY_FFMPEG_PATH, CONFIG_KEY_PG_URL, - CONFIG_KEY_PREVIEW_WINDOW, CONFIG_KEY_PROXY_DIVIDER, CONFIG_KEY_RENDERER_BACKEND, - CONFIG_KEY_SNAPSHOT_INTERVAL_SEC, CONFIG_KEY_STORAGE_BACKEND, CONFIG_KEY_USE_PROXY, - DEFAULT_PREVIEW_WINDOW_FORWARD, DEFAULT_SNAPSHOT_INTERVAL_SEC, DEFAULT_TRANSITION_SEC, - EXPORT_FORMAT_MP4, + audio_input_device, audio_input_devices, audio_output_device, audio_output_devices, + config_get_bool, config_get_int, config_get_string, config_set_bool, config_set_int, + config_set_string, encoding_formats, proxy_dividers, renderer_backends, set_audio_input_device, + set_audio_output_device, set_theme_dark, theme_is_dark, CONFIG_KEY_DEFAULT_TRANSITION_SEC, + CONFIG_KEY_DISK_CACHE_PATH, CONFIG_KEY_FFMPEG_PATH, CONFIG_KEY_PG_URL, + CONFIG_KEY_PREVIEW_WINDOW, CONFIG_KEY_PROXY_DIVIDER, CONFIG_KEY_RENDERER_BACKEND, + CONFIG_KEY_SNAPSHOT_INTERVAL_SEC, CONFIG_KEY_STORAGE_BACKEND, CONFIG_KEY_USE_PROXY, + DEFAULT_PREVIEW_WINDOW_FORWARD, DEFAULT_SNAPSHOT_INTERVAL_SEC, DEFAULT_TRANSITION_SEC, + EXPORT_FORMAT_MP4, }; // The `DisplayBitDepth` config key lives with the format mapping it // drives (oak-render's backend); the preferences dropdown and the // window-layer consumer share the same key. -use oak_render::backend::CONFIG_KEY_DISPLAY_BIT_DEPTH; +use oak_core::backend::CONFIG_KEY_DISPLAY_BIT_DEPTH; // --------------------------------------------------------------------------- // Preferences @@ -373,13 +373,13 @@ impl PreferencesContent { }) .detach(); - // --- 色彩 Color: display ICC color management ----------------------- - // On by default: the viewer frames are transformed through the - // display's ICC profile (system profile, or a custom file below). - // A mode change re-evaluates the platform display policy and - // retags the windows immediately (no restart). - use crate::oakui::displaycolor::{CONFIG_KEY_COLOR_MODE, CONFIG_KEY_CUSTOM_ICC}; - let display_icc = cx.new(|cx| { + // --- 色彩 Color: display ICC color management ----------------------- + // On by default: the viewer frames are transformed through the + // display's ICC profile (system profile, or a custom file below). + // A mode change re-evaluates the platform display policy and + // retags the windows immediately (no restart). + use crate::oakui::displaycolor::{CONFIG_KEY_COLOR_MODE, CONFIG_KEY_CUSTOM_ICC}; + let display_icc = cx.new(|cx| { let mode = config_get_string(CONFIG_KEY_COLOR_MODE); CheckBox::new( 13, @@ -1685,8 +1685,8 @@ fn divider_label(divider: i32) -> String { /// The display string of a proxy lifecycle state. fn proxy_state_label(state: crate::oakui::engine::ProxyMediaState) -> String { - use crate::oakui::engine::ProxyMediaState; - match state { + use crate::oakui::engine::ProxyMediaState; + match state { ProxyMediaState::Missing => i18n::tr("proxydialog.state.missing"), ProxyMediaState::Generating => i18n::tr("proxydialog.state.generating"), ProxyMediaState::Ready => i18n::tr("proxydialog.state.ready"), @@ -1918,20 +1918,20 @@ impl ProjectPropertiesContent { let (working, gamut, transfer) = engine.read(cx).project_color_settings(); working_space.update(cx, |combo, cx| { combo.set_selected( - Some(oak_common::colormath::WorkingColorSpace::from_setting(&working) as usize), - cx, + Some(oak_core::colormath::WorkingColorSpace::from_setting(&working) as usize), + cx, ) }); output_gamut.update(cx, |combo, cx| { combo.set_selected( - Some(oak_common::colormath::OutputGamut::from_setting(&gamut) as usize), - cx, + Some(oak_core::colormath::OutputGamut::from_setting(&gamut) as usize), + cx, ) }); output_transfer.update(cx, |combo, cx| { combo.set_selected( - Some(oak_common::colormath::OutputTransfer::from_setting(&transfer) as usize), - cx, + Some(oak_core::colormath::OutputTransfer::from_setting(&transfer) as usize), + cx, ) }); @@ -2015,8 +2015,8 @@ impl ProjectPropertiesContent { /// The color pipeline settings currently selected in the combos, as /// the canonical persisted strings. fn color_settings(&self, cx: &App) -> (String, String, String) { - use oak_common::colormath::{OutputGamut, OutputTransfer, WorkingColorSpace}; - let working = self + use oak_core::colormath::{OutputGamut, OutputTransfer, WorkingColorSpace}; + let working = self .working_space .read(cx) .selected() @@ -4289,8 +4289,8 @@ impl Render for NewProjectContent { #[cfg(test)] mod tests { - use super::*; - fn keystroke(key: &str) -> Keystroke { + use super::*; + fn keystroke(key: &str) -> Keystroke { gpui::Keystroke::parse(key).unwrap() } diff --git a/crates/oak-app/src/lib.rs b/crates/oak-app/src/lib.rs index f6e1dbc13..e356ce921 100644 --- a/crates/oak-app/src/lib.rs +++ b/crates/oak-app/src/lib.rs @@ -25,7 +25,7 @@ //! directly (M14 R3: project open/save through the oaknode serializer, //! timeline edits through the oaktimeline edit commands on the oakundo //! global stack, the oakrender ticket arena for the viewers, the oaktask -//! export path, the oakcommon config store, and the oakstorage +//! export path, the oak_core config store, and the oakstorage //! write-through library — no `liboakengine` dylib, no C ABI). //! //! # Layout diff --git a/crates/oak-app/src/oakui/displaycolor.rs b/crates/oak-app/src/oakui/displaycolor.rs index d2d9dcdad..099c6fb27 100644 --- a/crates/oak-app/src/oakui/displaycolor.rs +++ b/crates/oak-app/src/oakui/displaycolor.rs @@ -52,7 +52,7 @@ //! ## The content space //! //! The chain starts from the project's output spec -//! ([`oak_render::color::pipeline_output_spec`]): sRGB content runs +//! ([`oak_core::color::pipeline_output_spec`]): sRGB content runs //! through the named sRGB/Rec.709 space of the active OCIO config, and //! non-sRGB content (P3/BT.2020 gamuts, PQ/HLG transfers) is converted to //! CIE XYZ (D65, unit luminance) first and flows through the ICC's @@ -82,9 +82,9 @@ use std::sync::{Arc, LazyLock, Mutex}; use std::time::{Duration, Instant}; -use oak_common::colormath::{output_spec_to_xyz_d65, OutputColorSpec, OutputGamut, OutputTransfer}; -use oak_common::configstore::ConfigStore; -use oak_render::color::{pipeline_output_spec, ColorProcessor}; +use oak_core::colormath::{output_spec_to_xyz_d65, OutputColorSpec, OutputGamut, OutputTransfer}; +use oak_core::configstore::ConfigStore; +use oak_core::color::{pipeline_output_spec, ColorProcessor}; /// Config key: the display color management mode ("icc" / "off"). The /// preference only applies where the platform policy allows self-management @@ -188,7 +188,7 @@ pub fn display_policy() -> DisplayPolicy { // sRGB; a non-sRGB project output can't be honored through it — warn // once so the degradation is visible in the log. #[cfg(target_os = "windows")] - if oak_common::displayicc::windows_acm_active() { + if oak_core::displayicc::windows_acm_active() { if pipeline_output_spec() != OutputColorSpec::default() { static WARNED: std::sync::OnceLock<()> = std::sync::OnceLock::new(); WARNED.get_or_init(|| { @@ -280,7 +280,7 @@ fn current_monitor_fingerprint(window: &gpui::Window, cx: &gpui::App) -> Option< #[cfg(target_os = "windows")] { let id = u64::from(window.display(cx)?.id()); - return oak_common::displayicc::windows_monitor_fingerprint(id); + return oak_core::displayicc::windows_monitor_fingerprint(id); } #[cfg(target_os = "linux")] { @@ -288,7 +288,7 @@ fn current_monitor_fingerprint(window: &gpui::Window, cx: &gpui::App) -> Option< let center = window.bounds().center(); let x = f64::from(center.x) * f64::from(window.scale_factor()); let y = f64::from(center.y) * f64::from(window.scale_factor()); - return oak_common::displayicc::x11_monitor_fingerprint_at(x, y); + return oak_core::displayicc::x11_monitor_fingerprint_at(x, y); } #[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "linux")))] { @@ -414,9 +414,9 @@ fn current() -> Option { /// inside `system_display_icc_for`); an unknown one (empty or malformed) /// falls back to the main-display profile — the pre-multi-monitor behavior. fn monitor_icc_path(monitor: &str) -> Option { - match oak_common::displayicc::monitor_ref_from_fingerprint(monitor) { - Some(monitor) => oak_common::displayicc::system_display_icc_for(&monitor), - None => oak_common::displayicc::system_display_icc(), + match oak_core::displayicc::monitor_ref_from_fingerprint(monitor) { + Some(monitor) => oak_core::displayicc::system_display_icc_for(&monitor), + None => oak_core::displayicc::system_display_icc(), } } diff --git a/crates/oak-app/src/oakui/engine.rs b/crates/oak-app/src/oakui/engine.rs index c7ac062da..ba694edf0 100644 --- a/crates/oak-app/src/oakui/engine.rs +++ b/crates/oak-app/src/oakui/engine.rs @@ -829,7 +829,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 { - oak_common::configstore::ConfigStore::instance() + oak_core::configstore::ConfigStore::instance() .get_bool(None, "UseProxyMedia", 1) != 0 } @@ -838,7 +838,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) { - oak_common::configstore::ConfigStore::instance().set( + oak_core::configstore::ConfigStore::instance().set( None, "UseProxyMedia", if enabled { "true" } else { "false" }, @@ -851,7 +851,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 { - oak_common::configstore::ConfigStore::instance() + oak_core::configstore::ConfigStore::instance() .get_int(None, "PlaybackDivider", 1) .clamp(1, 8) as i64 } @@ -859,7 +859,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) { - oak_common::configstore::ConfigStore::instance().set( + oak_core::configstore::ConfigStore::instance().set( None, "PlaybackDivider", ÷r.clamp(1, 8).to_string(), @@ -877,7 +877,7 @@ pub trait AppEngine: /// Whether playback stops at the last frame instead of looping (the C++ /// viewer `Stop on Last` toggle / `StopOnLastFrame` config). fn stop_on_last(&self) -> bool { - oak_common::configstore::ConfigStore::instance() + oak_core::configstore::ConfigStore::instance() .get_bool(None, "StopOnLastFrame", 0) != 0 } @@ -885,7 +885,7 @@ pub trait AppEngine: /// Sets the `StopOnLastFrame` config (the next tick past the end either /// pauses at the last frame or wraps around). fn set_stop_on_last(&mut self, enabled: bool, cx: &mut Context) { - oak_common::configstore::ConfigStore::instance().set( + oak_core::configstore::ConfigStore::instance().set( None, "StopOnLastFrame", if enabled { "true" } else { "false" }, @@ -897,14 +897,14 @@ pub trait AppEngine: /// value (`0` automatic / `1` only / `2` both), clamped to the valid /// range. fn waveform_mode(&self) -> i32 { - oak_common::configstore::ConfigStore::instance() + oak_core::configstore::ConfigStore::instance() .get_int(None, "ViewerWaveformMode", 0) .clamp(0, 2) } /// Sets the `ViewerWaveformMode` config value (clamped to `0..=2`). fn set_waveform_mode(&mut self, mode: i32, cx: &mut Context) { - oak_common::configstore::ConfigStore::instance().set( + oak_core::configstore::ConfigStore::instance().set( None, "ViewerWaveformMode", &mode.clamp(0, 2).to_string(), @@ -972,15 +972,15 @@ pub trait AppEngine: /// The project's color pipeline settings: /// `(working colorspace, output gamut, output transfer)` as the - /// persisted setting strings (see `oak_common::colormath`). The + /// persisted setting strings (see `oak_core::colormath`). The /// working colorspace is the pipeline's scene space (ACEScg by /// default, not hard-coded sRGB); the output pair is the delivery /// target for export and presentation. fn project_color_settings(&self) -> (String, String, String) { ( - oak_common::colormath::WorkingColorSpace::default().as_setting().to_string(), - oak_common::colormath::OutputGamut::default().as_setting().to_string(), - oak_common::colormath::OutputTransfer::default().as_setting().to_string(), + oak_core::colormath::WorkingColorSpace::default().as_setting().to_string(), + oak_core::colormath::OutputGamut::default().as_setting().to_string(), + oak_core::colormath::OutputTransfer::default().as_setting().to_string(), ) } diff --git a/crates/oak-app/src/oakui/graphops.rs b/crates/oak-app/src/oakui/graphops.rs index 488787cd2..a5a74666c 100644 --- a/crates/oak-app/src/oakui/graphops.rs +++ b/crates/oak-app/src/oakui/graphops.rs @@ -2450,7 +2450,7 @@ pub fn remove_node(p: &ProjectRef, node: NodeId) -> Result<(), String> { // --------------------------------------------------------------------------- /// A process-wide test lock: the app's tests share the oakundo global -/// stack, the oakcommon config store and the codec decode sessions, so any +/// stack, the oak_core config store and the codec decode sessions, so any /// test touching them serializes on this lock. #[cfg(test)] pub fn test_lock() -> std::sync::MutexGuard<'static, ()> { diff --git a/crates/oak-app/src/oakui/mock.rs b/crates/oak-app/src/oakui/mock.rs index e9ff15dc1..13070af89 100644 --- a/crates/oak-app/src/oakui/mock.rs +++ b/crates/oak-app/src/oakui/mock.rs @@ -43,19 +43,19 @@ use std::sync::{Arc, Mutex}; use std::time::Instant; use gpui::effect_stack::{ - EffectCardKind, EffectData, EffectId, EffectStackDataSource, EffectStackEvent, + EffectCardKind, EffectData, EffectId, EffectStackDataSource, EffectStackEvent, }; use gpui::node_graph::{ - EdgeData, EdgeId, NodeData, NodeGraphDataSource, NodeGraphEvent, NodeId, PortData, - PortDataType, PortId, PortKind, + EdgeData, EdgeId, NodeData, NodeGraphDataSource, NodeGraphEvent, NodeId, PortData, + PortDataType, PortId, PortKind, }; use gpui::timeline::{ - ClipData, ClipId, Frame, FrameRange, FrameRate, Marker, TimelineDataSource, TimelineEvent, - TrackData, TrackKind, TrimEdge, + ClipData, ClipId, Frame, FrameRange, FrameRate, Marker, TimelineDataSource, TimelineEvent, + TrackData, TrackKind, TrimEdge, }; use gpui::{ - hsla, point, prelude::*, px, App, Context, Entity, Hsla, Pixels, Point, RenderImage, - SharedString, + hsla, point, prelude::*, px, App, Context, Entity, Hsla, Pixels, Point, RenderImage, + SharedString, }; use gpui_widgets::audio_meter::AudioMeterDataSource; use gpui_widgets::project_explorer::{ProjectDataSource, ProjectEntry}; @@ -67,8 +67,8 @@ 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, - Project, ScopeData, Sequence, VideoFormat, WizardFootage, WizardSyncOffset, + AppEngine, EngineGateway, ExportEvent, ExportSession, LibraryProject, Monitor, MulticamState, + Project, ScopeData, Sequence, VideoFormat, WizardFootage, WizardSyncOffset, }; use super::graphops; use super::transport::TransportState; @@ -2060,7 +2060,7 @@ impl AppEngine for MockEngine { let trimmed = path.trim().to_string(); // Validate like the real engine (a bogus path keeps the dialog open). if !trimmed.is_empty() { - oak_render::color::set_up_default_config_from(Some(&trimmed)) + oak_core::color::set_up_default_config_from(Some(&trimmed)) .map_err(|e| e.to_string())?; } self.ocio_config = trimmed; @@ -2582,11 +2582,11 @@ 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 oak_node::node::NodeCore; - use oak_node::sequence::SequenceBehavior; - use oak_node::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 project = graphops::create_project(); let sequence = graphops::create_sequence(&project, "Multicam Demo"); // A video track list with four tracks, wired into the sequence. { @@ -2863,10 +2863,10 @@ impl MockEngine { #[cfg(test)] mod tests { - use super::*; - use gpui::TestAppContext; + use super::*; + use gpui::TestAppContext; - fn demo_engine(app: &mut gpui::App) -> Entity { + fn demo_engine(app: &mut gpui::App) -> Entity { app.new(|cx| MockEngine::demo(cx)) } @@ -2932,8 +2932,8 @@ mod tests { /// The stop-on-last tick pauses on the final frame instead of wrapping. #[test] fn clock_tick_stops_on_the_last_frame_when_asked() { - use std::time::{Duration, Instant}; - let mut clock = MockClock::new(FrameRate::new(30, 1)); + use std::time::{Duration, Instant}; + let mut clock = MockClock::new(FrameRate::new(30, 1)); clock.play(); // 10 s at 30 fps = 300 frames into a 5-frame sequence: wrapped 60×. clock.started = Some((Instant::now() - Duration::from_secs(10), Frame(0))); @@ -2953,8 +2953,8 @@ mod tests { /// Without stop-on-last the tick wraps modulo the sequence length. #[test] fn clock_tick_loops_when_not_stopping() { - use std::time::{Duration, Instant}; - let mut clock = MockClock::new(FrameRate::new(30, 1)); + use std::time::{Duration, Instant}; + let mut clock = MockClock::new(FrameRate::new(30, 1)); clock.play(); clock.started = Some((Instant::now() - Duration::from_secs(10), Frame(0))); diff --git a/crates/oak-app/src/oakui/mod.rs b/crates/oak-app/src/oakui/mod.rs index cd0bae8b5..2bf5c7d20 100644 --- a/crates/oak-app/src/oakui/mod.rs +++ b/crates/oak-app/src/oakui/mod.rs @@ -29,7 +29,7 @@ //! * [`real`] — [`RealEngine`](real::RealEngine) and //! [`RealClock`](real::RealClock), the real engine. M14 R3: it calls the //! oak* module crates' Rust APIs directly (oaknode / oaktimeline / -//! oakundo / oakrender / oaktask / oakcodec / oakaudio / oakcommon / +//! oakundo / oakrender / oaktask / oakcodec / oakaudio / oak_core / //! oakstorage — no `liboakengine` dylib, no C ABI) behind the same //! [`EngineGateway`](engine::EngineGateway) seam the mock implements. //! * [`graphops`] / [`effectchain`] / [`renderops`] — the app's assembly diff --git a/crates/oak-app/src/oakui/real.rs b/crates/oak-app/src/oakui/real.rs index 568a4603f..77f9a40fc 100644 --- a/crates/oak-app/src/oakui/real.rs +++ b/crates/oak-app/src/oakui/real.rs @@ -44,7 +44,7 @@ //! listener and cancel atom. //! * **Config** — the preferences (renderer backend, language, theme, //! cache dir, proxy policy, snapshot interval, default transition, -//! audio devices) round-trip through the oakcommon config store; the +//! audio devices) round-trip through the oak_core config store; the //! audio device selection additionally applies live through oakaudio's //! manager. //! * **Storage** — the write-through library binds every opened project @@ -66,12 +66,12 @@ use std::sync::{Arc, Mutex}; use std::time::Instant; use gpui::effect_stack::{ - EffectCardKind, EffectData, EffectId, EffectStackDataSource, EffectStackEvent, + EffectCardKind, EffectData, EffectId, EffectStackDataSource, EffectStackEvent, }; use gpui::node_graph::{NodeGraphDataSource, NodeGraphEvent}; use gpui::timeline::{ - ClipData, ClipId, Frame, FrameRange, FrameRate, Marker, TimelineDataSource, TimelineEvent, - TrackData, TrackHeaderEvent, TrackKind, TrimEdge, + ClipData, ClipId, Frame, FrameRange, FrameRate, Marker, TimelineDataSource, TimelineEvent, + TrackData, TrackHeaderEvent, TrackKind, TrimEdge, }; use gpui::{prelude::*, px, App, Context, Entity, Hsla, Pixels, RenderImage, SharedString}; use gpui_widgets::audio_meter::AudioMeterDataSource; @@ -86,8 +86,8 @@ use oak_timeline::handle::CHandle; use oak_timeline::util::NodeRef; use super::engine::{ - AppEngine, EngineGateway, ExportSession, LibraryProject, Monitor, MulticamState, Project, - ScopeData, Sequence, SequenceParameters, VideoFormat, WizardFootage, WizardSyncOffset, + AppEngine, EngineGateway, ExportSession, LibraryProject, Monitor, MulticamState, Project, + ScopeData, Sequence, SequenceParameters, VideoFormat, WizardFootage, WizardSyncOffset, }; use super::frames::{bgra_bytes_to_render_image, f32_rgba_to_bgra_image, synthetic_frame_samples}; use super::graphops::{self, ProjectRef}; @@ -714,10 +714,10 @@ fn rendered_to_owned_image(rendered: &super::renderops::RenderedFrame) -> Option /// The app-side output node for F32 frames (working colorspace → the /// project's output colorspace); pass-through in the legacy working space. fn apply_output_node_f32(samples: &mut [f32]) { - oak_common::colormath::working_to_display_target( - samples, - oak_render::color::pipeline_working_space(), - oak_render::color::pipeline_output_spec(), + oak_core::colormath::working_to_display_target( + samples, + oak_core::color::pipeline_working_space(), + oak_core::color::pipeline_output_spec(), ); } @@ -2378,8 +2378,8 @@ impl RealEngine { /// mapped onto the widget's badge enum; folders and footage without /// proxy state get none. fn proxy_badge_of(&self, id: u64) -> Option { - use gpui_widgets::project_explorer::ProxyBadge; - let project = self.project.as_ref()?; + use gpui_widgets::project_explorer::ProxyBadge; + let project = self.project.as_ref()?; let node = graphops::id_of(id)?; let guard = graphops::lock(project); let f = graphops::footage_behavior(&guard.graph, node)?; @@ -2547,7 +2547,7 @@ impl RealEngine { fn proxy_cache_path() -> String { let configured = config_get_string(CONFIG_KEY_DISK_CACHE_PATH); if configured.trim().is_empty() { - oak_common::filefunctions::default_disk_cache_path() + oak_core::filefunctions::default_disk_cache_path() } else { configured } @@ -2706,8 +2706,8 @@ impl RealEngine { f: &oak_node::footage::FootageBehavior, node: NodeId, ) -> super::engine::ProxyMediaState { - use super::engine::ProxyMediaState; - if self.proxy_runs.iter().any(|run| run.footage == node) { + use super::engine::ProxyMediaState; + if self.proxy_runs.iter().any(|run| run.footage == node) { return ProxyMediaState::Generating; } if f.proxy.is_empty() { @@ -2733,9 +2733,9 @@ 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 oak_audio::synchronizer::{place_by_source_time, SourceClip}; + use oak_audio::synchronizer::{place_by_source_time, SourceClip}; - let Some(project) = self.project.clone() else { + let Some(project) = self.project.clone() else { return; }; @@ -2857,12 +2857,12 @@ 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 oak_audio::synchronizer::place_by_waveform_offset; - use oak_audio::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 { + let Some(cache) = self.waveform_cache() else { return; }; let Some(project) = self.project.clone() else { @@ -3157,7 +3157,7 @@ impl RealEngine { // the render workers pick them up at graph-load time. { let guard = graphops::lock(&project); - oak_render::color::set_pipeline_color_settings( + oak_core::color::set_pipeline_color_settings( guard.working_color_space(), guard.output_color_spec(), ); @@ -3263,12 +3263,12 @@ impl RealEngine { .cloned() }); let applied = match stored.as_deref() { - None => oak_render::color::set_up_default_config(), - Some(path) => oak_render::color::set_up_default_config_from(Some(path)), + None => oak_core::color::set_up_default_config(), + Some(path) => oak_core::color::set_up_default_config_from(Some(path)), }; if let Err(e) = applied { println!("[real engine] project OCIO config apply failed: {e}"); - let _ = oak_render::color::set_up_default_config(); + let _ = oak_core::color::set_up_default_config(); } super::displaycolor::invalidate(); } @@ -5422,7 +5422,7 @@ impl AppEngine for RealEngine { } fn set_use_proxy_media(&mut self, enabled: bool, cx: &mut Context) { - oak_common::configstore::ConfigStore::instance().set( + oak_core::configstore::ConfigStore::instance().set( None, CONFIG_KEY_USE_PROXY, if enabled { "true" } else { "false" }, @@ -5436,7 +5436,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) { - oak_common::configstore::ConfigStore::instance().set( + oak_core::configstore::ConfigStore::instance().set( None, "PlaybackDivider", ÷r.clamp(1, 8).to_string(), @@ -5471,9 +5471,9 @@ impl AppEngine for RealEngine { // refuses an invalid config the same way). Applying is the // process-wide color config reload plus a full frame invalidation. if trimmed.is_empty() { - oak_render::color::set_up_default_config().map_err(|e| e.to_string())?; + oak_core::color::set_up_default_config().map_err(|e| e.to_string())?; } else { - oak_render::color::set_up_default_config_from(Some(&trimmed)) + oak_core::color::set_up_default_config_from(Some(&trimmed)) .map_err(|e| e.to_string())?; } { @@ -5531,9 +5531,9 @@ impl AppEngine for RealEngine { fn project_color_settings(&self) -> (String, String, String) { let Some(project) = self.project_ref() else { return ( - oak_common::colormath::WorkingColorSpace::default().as_setting().to_string(), - oak_common::colormath::OutputGamut::default().as_setting().to_string(), - oak_common::colormath::OutputTransfer::default().as_setting().to_string(), + oak_core::colormath::WorkingColorSpace::default().as_setting().to_string(), + oak_core::colormath::OutputGamut::default().as_setting().to_string(), + oak_core::colormath::OutputTransfer::default().as_setting().to_string(), ); }; let guard = graphops::lock(project); @@ -5547,16 +5547,16 @@ impl AppEngine for RealEngine { }; ( get( - oak_node::project::SETTING_WORKING_COLOR_SPACE, - oak_common::colormath::WorkingColorSpace::default().as_setting(), + oak_node::project::SETTING_WORKING_COLOR_SPACE, + oak_core::colormath::WorkingColorSpace::default().as_setting(), ), get( - oak_node::project::SETTING_OUTPUT_GAMUT, - oak_common::colormath::OutputGamut::default().as_setting(), + oak_node::project::SETTING_OUTPUT_GAMUT, + oak_core::colormath::OutputGamut::default().as_setting(), ), get( - oak_node::project::SETTING_OUTPUT_TRANSFER, - oak_common::colormath::OutputTransfer::default().as_setting(), + oak_node::project::SETTING_OUTPUT_TRANSFER, + oak_core::colormath::OutputTransfer::default().as_setting(), ), ) } @@ -5572,8 +5572,8 @@ impl AppEngine for RealEngine { return; }; // Normalize through the parsers so only canonical values persist. - let working = oak_common::colormath::WorkingColorSpace::from_setting(&working); - let spec = oak_common::colormath::OutputColorSpec::from_settings(&gamut, &transfer); + let working = oak_core::colormath::WorkingColorSpace::from_setting(&working); + let spec = oak_core::colormath::OutputColorSpec::from_settings(&gamut, &transfer); { let mut guard = graphops::lock(&project); guard.settings.insert( @@ -5592,7 +5592,7 @@ impl AppEngine for RealEngine { } // The app-side transforms read the process global; the workers pick // the new settings up with the next graph upload. - oak_render::color::set_pipeline_color_settings(working, spec); + oak_core::color::set_pipeline_color_settings(working, spec); // The workers derive their pipeline colors from the uploaded project // snapshot; a settings change alone does not bump the undo-stack // revision (the manager dedups re-uploads on it), so push an explicit @@ -7124,7 +7124,7 @@ pub fn encoding_formats() -> Vec<(i32, String, String)> { pub const EXPORT_FORMAT_MP4: i32 = 2; // --------------------------------------------------------------------------- -// Config (preferences) — the oakcommon config store directly +// Config (preferences) — the oak_core config store directly // --------------------------------------------------------------------------- /// The config key selecting the renderer backend (worker `create_renderer` @@ -7134,7 +7134,7 @@ pub const CONFIG_KEY_RENDERER_BACKEND: &str = "GraphicsBackend"; /// defaults to dark when the key is absent). pub const CONFIG_KEY_THEME: &str = "Theme"; /// The config key overriding the disk cache directory (empty = the -/// platform default `/mediacache`; honored by oakcommon's +/// platform default `/mediacache`; honored by oak_core's /// `default_disk_cache_path`, so oakrender/oaknode caches follow it). pub const CONFIG_KEY_DISK_CACHE_PATH: &str = "DiskCachePath"; /// The config key toggling proxy media use (`UseProxyMedia`, bool). @@ -7169,8 +7169,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 oak_common::configstore::ConfigStore { - oak_common::configstore::ConfigStore::instance() +fn config_store() -> &'static oak_core::configstore::ConfigStore { + oak_core::configstore::ConfigStore::instance() } /// Loads the persisted configuration from disk (once at startup, before @@ -7358,11 +7358,11 @@ pub fn library_list() -> Result, String> { #[cfg(test)] mod tests { - use super::*; - use std::sync::mpsc as std_mpsc; - use std::time::Duration; + use super::*; + use std::sync::mpsc as std_mpsc; + use std::time::Duration; - /// Serializes the media/FFmpeg-heavy tests (the codec library is not + /// Serializes the media/FFmpeg-heavy tests (the codec library is not /// thread-safe against concurrent decode sessions) and shares the /// process-global undo stack with the other app test modules. fn media_lock() -> std::sync::MutexGuard<'static, ()> { @@ -7740,11 +7740,11 @@ mod tests { fn process_backend_preview_path_is_zero_copy() { let _media = media_lock(); let _worker = WorkerBinGuard::set(); - use oak_render::manager::{RenderBackendChoice, RenderManager}; - use oak_render::procpool::{ - main_heap_frame_copies, reset_main_heap_frame_copies, DispatcherConfig, - }; - RenderManager::shutdown(); + use oak_render::manager::{RenderBackendChoice, RenderManager}; + use oak_render::procpool::{ + main_heap_frame_copies, reset_main_heap_frame_copies, DispatcherConfig, + }; + RenderManager::shutdown(); let config = DispatcherConfig { worker_bin: Some( std::path::Path::new(env!("CARGO_MANIFEST_DIR")) diff --git a/crates/oak-app/src/oakui/renderops.rs b/crates/oak-app/src/oakui/renderops.rs index f18b53d77..8a702702b 100644 --- a/crates/oak-app/src/oakui/renderops.rs +++ b/crates/oak-app/src/oakui/renderops.rs @@ -29,12 +29,12 @@ use std::sync::mpsc; use gpui::RenderImage; +use oak_core::texture::Texture; use oak_core::{PixelFormat, 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}; @@ -84,7 +84,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 { - oak_common::configstore::ConfigStore::instance().get_bool(None, "UseProxyMedia", 1) != 0 + oak_core::configstore::ConfigStore::instance().get_bool(None, "UseProxyMedia", 1) != 0 } /// The preview media of a footage node with the three-level proxy switch @@ -606,10 +606,10 @@ impl RenderedFrame { /// the project's output colorspace, in place on tightly packed samples. /// Pass-through in the legacy sRGB working space. fn apply_output_node_f32(samples: &mut [f32]) { - oak_common::colormath::working_to_display_target( - samples, - oak_render::color::pipeline_working_space(), - oak_render::color::pipeline_output_spec(), + oak_core::colormath::working_to_display_target( + samples, + oak_core::color::pipeline_working_space(), + oak_core::color::pipeline_output_spec(), ); } @@ -1437,9 +1437,9 @@ mod tests { // pixels; disabling restores them), not the color pipeline. Pin the // legacy sRGB pass-through so the pixel-value assertions hold // regardless of the ACEScg default. - oak_render::color::set_pipeline_color_settings( - oak_common::colormath::WorkingColorSpace::SrgbLegacy, - oak_common::colormath::OutputColorSpec::default(), + oak_core::color::set_pipeline_color_settings( + oak_core::colormath::WorkingColorSpace::SrgbLegacy, + oak_core::colormath::OutputColorSpec::default(), ); oak_undo::global::clear().unwrap(); let media = @@ -1697,7 +1697,7 @@ mod tests { let gdata; let goff; { - let oak_render::texture::Texture::Cpu(ref gf) = &graph_frame else { + let oak_core::texture::Texture::Cpu(ref gf) = &graph_frame else { panic!("graph render produced a non-CPU frame"); }; grow = gf.linesize_bytes(); @@ -1805,7 +1805,7 @@ mod tests { oak_core::PixelFormat::F32, ) .expect("graph render"); - let oak_render::texture::Texture::Cpu(ref gf) = texture else { + let oak_core::texture::Texture::Cpu(ref gf) = texture else { panic!("non-CPU frame"); }; let stride = gf.linesize_bytes(); @@ -2103,7 +2103,7 @@ mod tests { // Force the global proxy switch on and restore it afterwards (the // config store is process-global; the serialization lock held // above is the same one the other app test modules use). - let store = oak_common::configstore::ConfigStore::instance(); + let store = oak_core::configstore::ConfigStore::instance(); let old = store.get(None, "UseProxyMedia").unwrap_or_default(); store.set_bool(None, "UseProxyMedia", 1); diff --git a/crates/oak-audio/COVERAGE.md b/crates/oak-audio/COVERAGE.md index 3a3487523..96fcde9b0 100644 --- a/crates/oak-audio/COVERAGE.md +++ b/crates/oak-audio/COVERAGE.md @@ -78,8 +78,8 @@ | C++ | Rust 落点 | |---|---| -| `output_buffer_size()` | `config::output_buffer_size`(`oakcommon_config_get_int(nullptr,"AudioOutputBufferSize",0)`) | -| `device_name(is_output_device)` | `config::device_name`(`oakcommon_config_get` 两阶段;key = "AudioOutput"/"AudioInput") | +| `output_buffer_size()` | `config::output_buffer_size`(`oak_core_config_get_int(nullptr,"AudioOutputBufferSize",0)`) | +| `device_name(is_output_device)` | `config::device_name`(`oak_core_config_get` 两阶段;key = "AudioOutput"/"AudioInput") | ## 9. 刻意不迁移(drop) diff --git a/crates/oak-audio/Cargo.lock b/crates/oak-audio/Cargo.lock index 20b2e48d3..936789142 100644 --- a/crates/oak-audio/Cargo.lock +++ b/crates/oak-audio/Cargo.lock @@ -305,7 +305,7 @@ name = "oakaudio" version = "0.1.0" dependencies = [ "oakcodec", - "oakcommon", + "oak_core", "oakcore-rs", ] @@ -318,7 +318,7 @@ dependencies = [ ] [[package]] -name = "oakcommon" +name = "oak_core" version = "0.1.0" dependencies = [ "image", diff --git a/crates/oak-audio/Cargo.toml b/crates/oak-audio/Cargo.toml index fc6e3073c..bfefebb88 100644 --- a/crates/oak-audio/Cargo.toml +++ b/crates/oak-audio/Cargo.toml @@ -11,7 +11,6 @@ crate-type = ["staticlib", "rlib"] [dependencies] 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 diff --git a/crates/oak-audio/README.md b/crates/oak-audio/README.md index d54ca23ab..cfcc1ab43 100644 --- a/crates/oak-audio/README.md +++ b/crates/oak-audio/README.md @@ -47,8 +47,8 @@ functions) — frozen, implemented verbatim by `src/ffi.rs`. oakcodec encoder C ABI (`bridge::codec`) and waveform extraction decodes through the oakcodec decoder C ABI — exactly as the C++ does. No direct ffmpeg_bridge use in the record path. -7. **Config via oakcommon.** Device names and the output buffer size - read through `bridge::common` (`oakcommon_config_*`), preserving the +7. **Config via oak_core.** Device names and the output buffer size + read through `bridge::common` (`oak_core_config_*`), preserving the `audio_config` namespace semantics as a `config.rs` free-function module. diff --git a/crates/oak-audio/src/config.rs b/crates/oak-audio/src/config.rs index d03fa9502..575febbf7 100644 --- a/crates/oak-audio/src/config.rs +++ b/crates/oak-audio/src/config.rs @@ -15,12 +15,12 @@ // along with this program. If not, see . //! The `audio_config` namespace from `src/audio/src/configbridge.*`: -//! audio-specific configuration read through the oakcommon C ABI. +//! audio-specific configuration read through the oak_core C ABI. use std::error::Error; use std::ffi::CString; use std::str::FromStr; -use oak_common::configstore::*; +use oak_core::configstore::*; /// PortAudio output buffer size in frames; 0 = let PortAudio choose. /// /// `// CPP-PARITY: src/audio/src/configbridge.cpp:30` @@ -44,7 +44,7 @@ pub fn device_name(is_output_device: bool) -> Result> { let store = ConfigStore::instance(); let size = i32::from_str(store.get(None, key)?.as_str())?; if size <= 1 { - // Absent (OAKCOMMON_E_NOT_FOUND) or empty + // Absent (oak_core_E_NOT_FOUND) or empty return Err(Box::new(crate::error::Error::NotFound)); } let mut buf = vec![0u8; size as usize]; diff --git a/crates/oak-audio/src/manager.rs b/crates/oak-audio/src/manager.rs index ade328bd7..2cf0989d7 100644 --- a/crates/oak-audio/src/manager.rs +++ b/crates/oak-audio/src/manager.rs @@ -22,7 +22,7 @@ //! `include/audio/manager.h`). An empty handle reports `OAKAUDIO_E_STATE`. //! //! Recording goes through the oakcodec encoder C ABI ([`crate::bridge`]); -//! device/config lookups go through oakcommon. +//! device/config lookups go through oak_core. use std::ffi::c_void; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/crates/oak-audio/src/processor.rs b/crates/oak-audio/src/processor.rs index 4ef99d6a8..0c672f7e7 100644 --- a/crates/oak-audio/src/processor.rs +++ b/crates/oak-audio/src/processor.rs @@ -77,7 +77,7 @@ impl Default for ProcessorInner { } /// Map an oakcore [`SampleFormat`] to the equivalent ffmpeg [`Sample`]. -/// Replaces `FFmpegUtils::get_ffmpeg_sample_format` crossing the oakcommon +/// Replaces `FFmpegUtils::get_ffmpeg_sample_format` crossing the oak_core /// C ABI (`// CPP-PARITY: src/common/src/ffmpegutils.cpp:83`). fn to_ffmpeg_sample_format(fmt: SampleFormat) -> Sample { match fmt { diff --git a/crates/oak-cli/Cargo.lock b/crates/oak-cli/Cargo.lock index 4af6b8780..a2efadabf 100644 --- a/crates/oak-cli/Cargo.lock +++ b/crates/oak-cli/Cargo.lock @@ -879,7 +879,7 @@ dependencies = [ ] [[package]] -name = "oakcommon" +name = "oak_core" version = "0.1.0" dependencies = [ "image", @@ -900,7 +900,7 @@ dependencies = [ "libc", "oakaudio", "oakcodec", - "oakcommon", + "oak_core", "oakcore-rs", "oaknode", "oakplugin", diff --git a/crates/oak-cli/Cargo.toml b/crates/oak-cli/Cargo.toml index 4dc8ce996..54256b6bd 100644 --- a/crates/oak-cli/Cargo.toml +++ b/crates/oak-cli/Cargo.toml @@ -32,9 +32,8 @@ clap = { version = "4", features = ["derive"] } # direct Rust call into the oak* rlibs (oaknode for projects/footage, # oaktimeline for the track/clip commands, oakrender for the ticket arena, # oakcodec for the export formats/codecs, oaktask for the export task, -# oakcommon/oakcore-rs for the shared value types). No liboakengine dylib, +# oak_core/oakcore-rs for the shared value types). No liboakengine dylib, # no C ABI, no build.rs link step, no host shims. -oak-common = { path = "../oak-common" } oak-core = { path = "../oak-core" } oak-node = { path = "../oak-node" } oak-timeline = { path = "../oak-timeline" } diff --git a/crates/oak-cli/README.md b/crates/oak-cli/README.md index 196a024d6..75edfbfe7 100644 --- a/crates/oak-cli/README.md +++ b/crates/oak-cli/README.md @@ -20,7 +20,7 @@ cargo test # unit + integration tests The crate is **self-contained** (M14 R2): it links the oak* module rlibs directly (`oaknode`, `oaktimeline`, `oakcodec`, `oakrender`, `oaktask`, -`oakcommon`) — no `liboakengine` dylib, no C ABI, no build.rs link step. +`oak_core`) — no `liboakengine` dylib, no C ABI, no build.rs link step. `cargo test -p oak-cli` stands alone. ## Subcommands diff --git a/crates/oak-cli/src/engine.rs b/crates/oak-cli/src/engine.rs index 50cd0f029..356145d09 100644 --- a/crates/oak-cli/src/engine.rs +++ b/crates/oak-cli/src/engine.rs @@ -17,7 +17,7 @@ //! Module-native engine helpers (M14 R2). //! //! oak-cli links the oak* module rlibs directly (oaknode / oaktimeline / -//! oakcodec / oakrender / oaktask / oakcommon) instead of the built +//! oakcodec / oakrender / oaktask / oak_core) instead of the built //! liboakengine dylib's C ABI. This module is the CLI's own assembly //! layer: it reproduces the facade operations the subcommands need — //! project load/create, footage probe, sequence + clip assembly, montage @@ -43,14 +43,14 @@ 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, + AudioTicketParams, MontageClip, TicketPayload, VideoTicketParams, }; +use oak_timeline::undogeneral::TimelineAddTrackCommand; +use oak_timeline::undopointer::TrackPlaceBlockCommand; +use oak_timeline::util::NodeRef; /// The shared project reference (the modules' domain project handle). pub type ProjectRef = Arc>; @@ -663,7 +663,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(oak_render::texture::Texture::Cpu(frame))) => { + Ok(TicketPayload::Video(oak_core::texture::Texture::Cpu(frame))) => { Ok(RenderedFrame { width: frame.width, height: frame.height, diff --git a/crates/oak-codec/Cargo.toml b/crates/oak-codec/Cargo.toml index 48976c0fe..1ec8fa940 100644 --- a/crates/oak-codec/Cargo.toml +++ b/crates/oak-codec/Cargo.toml @@ -9,7 +9,6 @@ license = "GPL-3.0-or-later" crate-type = ["staticlib", "rlib"] [dependencies] -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 diff --git a/crates/oak-codec/README.md b/crates/oak-codec/README.md index d5561b62e..23be05f61 100644 --- a/crates/oak-codec/README.md +++ b/crates/oak-codec/README.md @@ -42,15 +42,15 @@ and never blocks. virtual chain. 3. **`Frame` owns its params by value.** `olive::Frame` wraps an `OakVideoParams` handle plus a `Vec` pixel buffer. In Rust the - params are held as an `oakcommon::videoparams::VideoParams` value - (single-lib unification dropped the refcounted oakcommon handle); + params are held as an `oak_core::videoparams::VideoParams` value + (single-lib unification dropped the refcounted oak_core handle); the buffer is a plain `Vec`. 4. **No adapter layer.** Codec calls the other module crates directly - (`oakcommon`, `oakcore-rs`, `oakffmpeg-link`), keeping the 2026-08 + (`oak_core`, `oakcore-rs`, `oakffmpeg-link`), keeping the 2026-08 decision recorded in NOTES.md §6. Only genuinely repeated conversions survive as small module-local helpers. 5. **XML stays on the C++ side.** `EncodingParams::load/save` use - oakcommon's C++ `XmlStreamWriter/Reader` classes + oak_core's C++ `XmlStreamWriter/Reader` classes (`src/common/src/xmlutils.h`), exactly as oaknode/oakrender do — the one C++-to-C++ coupling the bridge cannot cover (NOTES.md §7). 6. **Threading.** `FrameManager` keeps its background GC thread behind diff --git a/crates/oak-codec/src/conformmanager.rs b/crates/oak-codec/src/conformmanager.rs index 391c96cbb..e67748e31 100644 --- a/crates/oak-codec/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 oak_common::filefunctions::FileFunctions; +use oak_core::filefunctions::FileFunctions; use std::path::Path; /// Conform state of one audio stream. @@ -184,7 +184,7 @@ fn conform_filenames( out } -/// `oakcommon_filefunctions_get_unique_file_identifier` wrapper. +/// `oak_core_filefunctions_get_unique_file_identifier` wrapper. fn unique_file_identifier(filename: &str) -> String { FileFunctions::new() .get_unique_file_identifier(filename) diff --git a/crates/oak-codec/src/decoder.rs b/crates/oak-codec/src/decoder.rs index 7e2509be3..827cb7417 100644 --- a/crates/oak-codec/src/decoder.rs +++ b/crates/oak-codec/src/decoder.rs @@ -26,7 +26,7 @@ use std::path::Path; use std::sync::{Arc, Mutex, OnceLock}; -use oak_common::cancelatom::CancelAtom; +use oak_core::cancelatom::CancelAtom; use oak_core::{Rational, TimeRange}; use crate::footagedescription::FootageDescription; @@ -113,7 +113,7 @@ pub enum RenderMode { /// "Don't force a color range" sentinel for /// [`RetrieveVideoParams::force_range`] (the actual ranges are the -/// `OAKCOMMON_COLOR_RANGE_*` values). +/// `oak_core_COLOR_RANGE_*` values). pub const K_COLOR_RANGE_DEFAULT: i32 = -1; /// `Decoder::RetrieveVideoParams` — what a video retrieve call needs. diff --git a/crates/oak-codec/src/encodingparams.rs b/crates/oak-codec/src/encodingparams.rs index e8f8b15c5..0b1a412ed 100644 --- a/crates/oak-codec/src/encodingparams.rs +++ b/crates/oak-codec/src/encodingparams.rs @@ -269,10 +269,10 @@ impl EncodingParams { } } - /// Load from a compact XML preset string (oakcommon C++ XmlStreamReader). + /// Load from a compact XML preset string (oak_core C++ XmlStreamReader). /// /// # CPP-PARITY - /// `EncodingParams::load` — uses oakcommon's C++ `XmlStreamReader` + /// `EncodingParams::load` — uses oak_core's C++ `XmlStreamReader` /// (`src/common/src/xmlutils.h`), a C++-to-C++ coupling the bridge /// cannot cover (NOTES.md §7). Preserves the load_v1 bug of not /// assigning `custom_range`. @@ -524,7 +524,7 @@ impl EncodingParams { // --------------------------------------------------------------------------- // Minimal XML helpers for the round-trip `load`/`save_to_string`. // -// CPP-PARITY: the C++ `load`/`save_to_string` go through oakcommon's +// CPP-PARITY: the C++ `load`/`save_to_string` go through oak_core's // `XmlStreamReader`/`XmlStreamWriter` (a C++-to-C++ coupling the Rust bridge // cannot cover, NOTES.md §7). Rather than returning `Err`, this port keeps a // minimal but faithful round-trip for the fields representable without the diff --git a/crates/oak-codec/src/ffmpeg.rs b/crates/oak-codec/src/ffmpeg.rs index 933280844..b8167e209 100644 --- a/crates/oak-codec/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 oak_common::cancelatom::CancelAtom; -use oak_common::colormath::YuvMatrix; -use oak_common::ocioutils::PixelFormat as OakPixelFormat; -use oak_common::videoparams::{Interlacing, VideoParams, VideoType}; +use oak_core::cancelatom::CancelAtom; +use oak_core::colormath::YuvMatrix; +use oak_core::ocioutils::PixelFormat as OakPixelFormat; +use oak_core::videoparams::{Interlacing, VideoParams, VideoType}; use oak_core::{PixelFormat, Rational, SampleFormat, TimeRange}; use crate::audioparams::AudioParams; @@ -69,10 +69,10 @@ use crate::encodingparams::EncodingParams; use crate::footagedescription::{FootageDescription, StreamEntry}; use crate::frame::Frame; -/// `OAKCOMMON_COLOR_RANGE_FULL`. -const OAKCOMMON_COLOR_RANGE_FULL: i32 = 1; -/// `OAKCOMMON_COLOR_RANGE_LIMITED`. -const OAKCOMMON_COLOR_RANGE_LIMITED: i32 = 0; +/// `oak_core_COLOR_RANGE_FULL`. +const oak_core_COLOR_RANGE_FULL: i32 = 1; +/// `oak_core_COLOR_RANGE_LIMITED`. +const oak_core_COLOR_RANGE_LIMITED: i32 = 0; /// `AVCOL_RANGE_JPEG` (full range; AVCOL_RANGE_MPEG = 1 is limited). const AVCOL_RANGE_JPEG: i32 = 2; /// swscale colorspace ids (`SWS_CS_*`, libswscale/swscale.h). @@ -372,9 +372,9 @@ impl Decoder for FFmpegDecoder { params.set_color_primaries(color_meta.color_primaries); params.set_color_transfer(color_meta.color_trc); params.set_color_range(if color_meta.full_range { - oak_common::videoparams::ColorRange::Full + oak_core::videoparams::ColorRange::Full } else { - oak_common::videoparams::ColorRange::Limited + oak_core::videoparams::ColorRange::Limited }); } Ok(Arc::new(frame)) @@ -1099,9 +1099,9 @@ impl DecoderState { // frame's own metadata (YUVJ sources are full range). The old path // forced MPEG/limited for everything, crushing full-range screen // captures and JPEG-derived footage. - let full_range = if force_range == OAKCOMMON_COLOR_RANGE_FULL { + let full_range = if force_range == oak_core_COLOR_RANGE_FULL { true - } else if force_range == OAKCOMMON_COLOR_RANGE_LIMITED { + } else if force_range == oak_core_COLOR_RANGE_LIMITED { false } else { yuvj_full || raw_range == AVCOL_RANGE_JPEG @@ -1949,7 +1949,7 @@ fn convert_rgba8_to_f32(data: &[u8], w: u32, h: u32, stride: usize) -> Vec { /// colorspace tables and full ranges on both sides, so no matrix and no /// range recompression was applied. 10/12-bit sources arrive left-shifted /// to 16-bit (code << 6 / code << 4) — exactly the code-value scale -/// [`oak_common::colormath::yuv444p16_to_rgb_f32`] expects. +/// [`oak_core::colormath::yuv444p16_to_rgb_f32`] expects. fn convert_yuv444p16_to_rgba_f32( out: &ffmpeg::frame::Video, w: u32, @@ -1958,7 +1958,7 @@ fn convert_yuv444p16_to_rgba_f32( full_range: bool, ) -> Vec { let mut rgba = vec![0.0f32; (w as usize) * (h as usize) * 4]; - oak_common::colormath::yuv444p16_to_rgb_f32( + oak_core::colormath::yuv444p16_to_rgb_f32( out.data(0), out.stride(0), out.data(1), @@ -2111,9 +2111,9 @@ fn probe_file(filename: &str, cancelled: Option<&CancelAtom>) -> Option VideoParams { let mut vp = VideoParams::new_basic( - 1920, - 1080, - oak_common::ocioutils::PixelFormat::from_code(0), - 4, - 1, - 1, - 0, - 1, + 1920, + 1080, + oak_core::ocioutils::PixelFormat::from_code(0), + 4, + 1, + 1, + 0, + 1, ); vp.set_stream_index(index); vp diff --git a/crates/oak-codec/src/frame.rs b/crates/oak-codec/src/frame.rs index 568ef0ae2..5c0fefc9d 100644 --- a/crates/oak-codec/src/frame.rs +++ b/crates/oak-codec/src/frame.rs @@ -16,13 +16,13 @@ //! `olive::Frame` — a CPU pixel buffer plus a [`VideoParams`] value. //! -//! Mirrors `src/codec/src/frame.h`. The params are held as an oakcommon +//! Mirrors `src/codec/src/frame.h`. The params are held as an oak_core //! [`VideoParams`] value (single-lib unification; the former refcounted -//! oakcommon handle is gone, so copies are plain clones); the pixel data +//! oak_core handle is gone, so copies are plain clones); the pixel data //! itself is a plain `Vec`. Line-size and pixel-format math lives //! here. -use oak_common::videoparams::VideoParams; +use oak_core::videoparams::VideoParams; use oak_core::{PixelFormat, Rational}; /// Number of channels in the internal RGBA pipeline layout @@ -331,7 +331,7 @@ impl Frame { #[cfg(test)] mod tests { use super::*; - use oak_common::ocioutils::PixelFormat as OakPixelFormat; + use oak_core::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 oak_common::ocioutils::PixelFormat as OakPixelFormat; + use oak_core::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/oak-codec/src/framemanager.rs b/crates/oak-codec/src/framemanager.rs index 7d4a19564..14e9a2f43 100644 --- a/crates/oak-codec/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 oak_common::videoparams::VideoParams; +use oak_core::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 oak_common::ocioutils::PixelFormat as OakPixelFormat; + use oak_core::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/oak-codec/src/hwdecode.rs b/crates/oak-codec/src/hwdecode.rs index 97136e773..f4e0d185e 100644 --- a/crates/oak-codec/src/hwdecode.rs +++ b/crates/oak-codec/src/hwdecode.rs @@ -106,7 +106,7 @@ pub fn hardware_decoding_enabled() -> bool { if let Ok(v) = std::env::var("OAK_HWACCEL") { return v != "0"; } - match oak_common::configstore::ConfigStore::instance() + match oak_core::configstore::ConfigStore::instance() .get(None, CONFIG_KEY_HARDWARE_DECODING) { Ok(value) => value != "false", diff --git a/crates/oak-codec/src/oiio.rs b/crates/oak-codec/src/oiio.rs index 54ab0ec0d..881e7c79a 100644 --- a/crates/oak-codec/src/oiio.rs +++ b/crates/oak-codec/src/oiio.rs @@ -18,7 +18,7 @@ //! //! Mirrors `src/codec/src/oiio/{oiiodecoder,oiioencoder}.{h,cpp}`. OIIO //! frame conversion goes through the local -//! [`crate::oiioframebridge`] helpers plus oakcommon's OIIO mapping +//! [`crate::oiioframebridge`] helpers plus oak_core's OIIO mapping //! functions. //! //! The OIIO dylib (`liboakoiio`) is not linked into this build, so every @@ -58,9 +58,9 @@ impl Decoder for OIIODecoder { } fn probe( - &self, - _filename: &str, - _cancelled: Option<&oak_common::cancelatom::CancelAtom>, + &self, + _filename: &str, + _cancelled: Option<&oak_core::cancelatom::CancelAtom>, ) -> Option { // Probing is a dylib operation; without it we cannot report anything. None @@ -113,12 +113,12 @@ impl Decoder for OIIODecoder { } fn conform_audio( - &self, - _output_filenames: &[String], - _sample_rate: i32, - _channel_layout: u64, - _sample_format: i32, - _cancelled: Option<&oak_common::cancelatom::CancelAtom>, + &self, + _output_filenames: &[String], + _sample_rate: i32, + _channel_layout: u64, + _sample_format: i32, + _cancelled: Option<&oak_core::cancelatom::CancelAtom>, ) -> crate::error::Result<()> { Err(crate::error::Error::Failed(Self::NOT_AVAILABLE.to_string())) } diff --git a/crates/oak-codec/src/oiioframebridge.rs b/crates/oak-codec/src/oiioframebridge.rs index 091a2849e..5dc83ba4b 100644 --- a/crates/oak-codec/src/oiioframebridge.rs +++ b/crates/oak-codec/src/oiioframebridge.rs @@ -18,8 +18,8 @@ //! frame <-> pixel-buffer conversion. //! //! Mirrors `src/codec/src/oiioframebridge.{h,cpp}`. These are internal C++ -//! functions that moved into codec from oakcommon (NOTES.md §oakcommon侧修复); -//! oakcommon keeps its OIIO mapping functions; the frame conversion itself +//! functions that moved into codec from oak_core (NOTES.md §oak_core侧修复); +//! oak_core keeps its OIIO mapping functions; the frame conversion itself //! lives here. //! //! The C++ bridge copies pixels through the live OpenImageIO `ImageBuf` @@ -30,8 +30,8 @@ //! 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 oak_common::ocioutils::PixelFormat as OakPixelFormat; -use oak_common::videoparams::VideoParams; +use oak_core::ocioutils::PixelFormat as OakPixelFormat; +use oak_core::videoparams::VideoParams; use crate::frame::Frame; use oak_core::Rational; use std::ffi::c_int; diff --git a/crates/oak-codec/src/proxymanager.rs b/crates/oak-codec/src/proxymanager.rs index 24ea3c6eb..fc5d1889a 100644 --- a/crates/oak-codec/src/proxymanager.rs +++ b/crates/oak-codec/src/proxymanager.rs @@ -19,12 +19,12 @@ //! Mirrors `src/codec/src/proxymanager.h`. Stateless (NOTES.md): actual //! transcodes are delegated to the global task submit callback //! ([`crate::task`]); with no registrar, `get_or_start` reports the proxy -//! as missing. `proxy_params_from_config` reads the oakcommon config store +//! as missing. `proxy_params_from_config` reads the oak_core config store //! with the compiled-in defaults as fallback (1280x720 / divider 1 / crf 23 //! / "mp4" / "veryfast" / audio included). -use oak_common::configstore::ConfigStore; -use oak_common::filefunctions::FileFunctions; +use oak_core::configstore::ConfigStore; +use oak_core::filefunctions::FileFunctions; use std::path::Path; /// Proxy state of a proxy file on disk. @@ -127,13 +127,13 @@ impl ProxyManager { ProxyParams::default() } - /// Proxy parameters read from the oakcommon config, with the compiled-in + /// Proxy parameters read from the oak_core config, with the compiled-in /// defaults as fallback. /// /// # CPP-PARITY /// `src/codec/src/proxymanager.h` `proxy_params_from_config` — reads /// ProxyWidth/ProxyHeight/ProxyDivider/ProxyCRF/ProxyPreset/ - /// ProxyIncludeAudio via `oakcommon_config_*`. + /// ProxyIncludeAudio via `oak_core_config_*`. pub fn proxy_params_from_config() -> ProxyParams { let mut p = ProxyParams::default(); p.width = config_get_int("ProxyWidth", p.width); @@ -387,17 +387,17 @@ fn cstr_slice(a: &[u8; 32]) -> &str { std::str::from_utf8(&a[..end]).unwrap_or("") } -/// `oakcommon_config_get_int` wrapper (null group). +/// `oak_core_config_get_int` wrapper (null group). fn config_get_int(key: &str, default: i32) -> i32 { ConfigStore::instance().get_int(None, key, default) } -/// `oakcommon_config_get_bool` wrapper (null group). +/// `oak_core_config_get_bool` wrapper (null group). fn config_get_bool(key: &str, default: i32) -> i32 { ConfigStore::instance().get_bool(None, key, default) } -/// `oakcommon_config_get` string read; `None` when the stored value is +/// `oak_core_config_get` string read; `None` when the stored value is /// empty or absent. fn config_get_str(key: &str) -> Option { match ConfigStore::instance().get(None, key) { @@ -406,14 +406,14 @@ fn config_get_str(key: &str) -> Option { } } -/// `oakcommon_filefunctions_get_unique_file_identifier` wrapper. +/// `oak_core_filefunctions_get_unique_file_identifier` wrapper. fn unique_file_identifier(filename: &str) -> String { FileFunctions::new() .get_unique_file_identifier(filename) .unwrap_or_default() } -/// `oakcommon_filefunctions_get_application_path` read. +/// `oak_core_filefunctions_get_application_path` read. fn application_path() -> String { FileFunctions::new() .get_application_path() diff --git a/crates/oak-codec/src/realmedia_tests.rs b/crates/oak-codec/src/realmedia_tests.rs index a7400b5eb..d359cfbd6 100644 --- a/crates/oak-codec/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 oak_common::ocioutils::PixelFormat as OakPixelFormat; -use oak_common::videoparams::VideoParams; +use oak_core::ocioutils::PixelFormat as OakPixelFormat; +use oak_core::videoparams::VideoParams; use crate::decoder::{ CodecStream, Decoder, RenderMode, RetrieveAudioStatus, RetrieveVideoParams, K_COLOR_RANGE_DEFAULT, @@ -503,7 +503,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 = oak_common::configstore::ConfigStore::instance(); + let config = oak_core::configstore::ConfigStore::instance(); let key = crate::hwdecode::CONFIG_KEY_HARDWARE_DECODING; let decode_at = |time: i64| -> (Option, Arc) { diff --git a/crates/oak-codec/src/testmedia.rs b/crates/oak-codec/src/testmedia.rs index f9daabfab..ad801d6ff 100644 --- a/crates/oak-codec/src/testmedia.rs +++ b/crates/oak-codec/src/testmedia.rs @@ -37,8 +37,8 @@ use std::path::Path; -use oak_common::ocioutils::PixelFormat as OakPixelFormat; -use oak_common::videoparams::VideoParams; +use oak_core::ocioutils::PixelFormat as OakPixelFormat; +use oak_core::videoparams::VideoParams; use oak_core::{PixelFormat, Rational, SampleFormat}; use crate::encodingparams::EncodingParams; diff --git a/crates/oak-codec/tarpaulin-report.html b/crates/oak-codec/tarpaulin-report.html index 8283c2ce2..a9009ab3c 100644 --- a/crates/oak-codec/tarpaulin-report.html +++ b/crates/oak-codec/tarpaulin-report.html @@ -193,8 +193,8 @@ body {