workspace: kebab-case crates, app under crates/oak-app, shared versions
CI / Build & test (Windows) (push) Failing after 7s
CI / Build & test (Windows) (push) Failing after 7s
All crates take the oak-* kebab-case naming (oak-audio, oak-codec, oak-common, oak-core, oak-ffmpeg-link, oak-node, oak-otio, oak-plugin, oak-render, oak-storage, oak-task, oak-timeline, oak-undo), with the lib identifiers rewritten (oakrender:: -> oak_render::, oakcore_rs:: -> oak_core::, ...) across all 226 referencing files. The GUI application moves from the workspace root into crates/oak-app/: src/, build.rs (paths fixed for the new location) and tests/ travel with it, the root Cargo.toml becomes workspace-only ([workspace] + workspace.package + profiles), and the app package inherits the workspace version. The screenshots example becomes a standalone crate examples/simple_player/ with its own Cargo.toml. Every crate now inherits the single workspace version (version.workspace = true), and the workflows' crate paths and the build docs follow the renames. Validated with a clean cargo check --workspace.
This commit is contained in:
@@ -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());
|
||||
(
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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: <path>` 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 {
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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<ProjectRef, String> {
|
||||
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<Mo
|
||||
pub fn render_manager_init() -> 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
|
||||
|
||||
Reference in New Issue
Block a user