refactor: drop internal bridge/ffi layers; exporter family lands

Single-lib cleanup: the per-crate src/bridge/ and src/ffi.rs layers are
gone (oakundo/oakcommon/oaknode/oaktimeline/oakcodec/oakaudio/
oakrender/oaktask/oakplugin/oakstorage); cross-crate calls are plain
Rust, CHandle marshalling shrinks to the oakengine boundary, and tests
call the Rust APIs directly (pure C-ABI wrapper tests removed where
the domain layer already covers the behavior).

exporter.h family implemented: oakengine_export_render (CLI contract),
oakengine_export_render_with_params (was a stub), last_error and
progress callback; synchronous path reuses task_create_export +
start_sync. Fixes on the way: oaktask video ticket self-deadlock,
audio params dropped on the export path, codec encoder AAC slicing and
H.264 time base. Real-mp4 tests cover both entry points, progress and
the illegal-argument matrix.

Also: oakstorage session maps null project handles to None (version-
info path), configstore test double literal 3.14 -> 3.15 (clippy PI
lint), oakaudio output callback scratch buffer + env-aware P1 test,
cli media round-trip test uses a generated 16-frame clip (no more
minute-long debug runs).
This commit is contained in:
2026-08-16 00:33:45 +08:00
parent 2248be8567
commit ab1a2e9c7b
293 changed files with 27826 additions and 90128 deletions
+7 -16
View File
@@ -24,8 +24,9 @@
use std::sync::{Arc, Condvar, Mutex};
use oakcommon::cancelatom::CancelAtom;
use crate::error::{Error, Result};
use crate::handle::CHandle;
use crate::task::{Task, TaskBehavior};
/// Shared state between the parked task thread, the owning cache
@@ -41,19 +42,14 @@ pub struct CustomCacheState {
/// Callback invoked when the task is cancelled (not by `finish()`).
cancelled_callback: Mutex<Option<Box<dyn FnMut() + Send>>>,
/// Copy of the task's cancellation atom.
atom: CHandle,
atom: Arc<CancelAtom>,
}
impl CustomCacheState {
/// Mark the cache fill as complete and wake the parked task.
pub fn finish(&self) {
*self.cancelled_through_finish.lock().unwrap() = true;
if !self.atom.is_null() {
let atom = self.atom;
unsafe {
crate::bridge::render::oakrender_cancelatom_cancel(atom);
}
}
self.atom.cancel();
self.wait.notify_one();
}
@@ -71,12 +67,7 @@ impl CustomCacheState {
/// The full C++ `cancel()`: cancel the atom and run the cancel-event
/// hook. Used by the owning cache to abort a fill.
pub fn cancel(&self) {
if !self.atom.is_null() {
let atom = self.atom;
unsafe {
crate::bridge::render::oakrender_cancelatom_cancel(atom);
}
}
self.atom.cancel();
self.cancel_event();
}
@@ -104,7 +95,7 @@ impl CustomCacheTask {
pub fn new(sequence_name: &str) -> CustomCacheTask {
let base = Task::new(
&format!("Caching custom range for \"{sequence_name}\""),
CHandle::null(),
None,
);
let state = Arc::new(CustomCacheState {
cancelled_through_finish: Mutex::new(false),
@@ -145,7 +136,7 @@ impl TaskBehavior for CustomCacheTask {
/// `Err(Error::Cancelled)` if cancelled while waiting.
fn run(&mut self, task: &mut Task) -> Result<()> {
// Install the cancel hook on the task this behavior actually runs
// under (the outer task driven by the manager / C ABI). The
// under (the outer task driven by the manager). The
// constructor-installed hook on the inner `base` only fires when the
// base itself is cancelled; without this the outer `cancel()` would
// set the shared atom but never wake the parked thread.