structure: move jobs out of nodes/

This commit is contained in:
2026-09-03 17:44:46 +08:00
parent 4babbf5de8
commit cde4dddf32
34 changed files with 207 additions and 208 deletions
+8 -8
View File
@@ -109,8 +109,8 @@ impl FootageBehavior {
/// prior `streams`/`valid` state is preserved on failure (no partial
/// state).
pub fn probe(&mut self) -> crate::error::Result<()> {
use crate::error::Error;
// Direct probe through the oakcodec decoder registry (single-lib
use crate::error::Error;
// Direct probe through the oakcodec decoder registry (single-lib
// unification; replaces the former `oakcodec_decoder_probe` C ABI
// call).
let desc = oak_codec::decoder::receive_list_of_all_decoders()
@@ -355,7 +355,7 @@ impl NodeBehavior for FootageBehavior {
}
/// Emit the decode request (C++ `Footage::ProcessFootageRequest`): a
/// boxed [`crate::nodes::jobs::FootageJobPayload`] the render hooks
/// boxed [`crate::jobs::FootageJobPayload`] the render hooks
/// resolve to the decoded frame. A footage with no probed video stream
/// (or no filename) outputs nothing.
fn value(
@@ -390,7 +390,7 @@ impl NodeBehavior for FootageBehavior {
} else {
(self.filename.clone(), stream.index)
};
let payload = crate::nodes::jobs::FootageJobPayload {
let payload = crate::jobs::FootageJobPayload {
filename,
stream_index,
time,
@@ -768,10 +768,10 @@ fn stream_duration_seconds(duration: i64, time_base: (i32, i32)) -> oak_core::Ra
#[cfg(test)]
mod tests {
use super::*;
use oak_codec::footagedescription::{FootageDescription, StreamEntry};
use super::*;
use oak_codec::footagedescription::{FootageDescription, StreamEntry};
fn video_entry(stream_index: i32, duration: i64) -> StreamEntry {
fn video_entry(stream_index: i32, duration: i64) -> StreamEntry {
let mut vp = oak_core::videoparams::VideoParams::new_basic(
1920,
1080,
@@ -880,7 +880,7 @@ mod tests {
let NodeValue::Texture(handle) = table.get(ValueType::Texture).unwrap() else {
unreachable!()
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::FootageJobPayload>(handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::FootageJobPayload>(handle) }
.expect("footage output boxes a FootageJobPayload");
assert_eq!(payload.filename, "clip.mov");
assert_eq!(payload.stream_index, 1);
+1
View File
@@ -54,3 +54,4 @@ pub mod serializer;
pub mod track;
pub mod traverser;
pub mod value;
pub mod jobs;
+6 -6
View File
@@ -18,8 +18,8 @@
//! `olive::BlurFilterNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, Gizmo, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -580,12 +580,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
+5 -5
View File
@@ -18,8 +18,8 @@
//! `olive::ChromaKeyNode`, derived from `olive::OCIOBaseNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Key color input id (C++ `k_color_input`). Type: color; default
/// `Color(0.0, 1.0, 0.0, 1.0)` (opaque green).
@@ -441,11 +441,11 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = ChromaKeyNode;
assert_eq!(n.input_name(crate::nodes::ociobase::TEXTURE_INPUT), "Input");
@@ -19,8 +19,8 @@
//! `olive::ColorDifferenceKeyNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -307,11 +307,11 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = ColorDifferenceKeyNode;
assert_eq!(n.input_name(TEXTURE_INPUT), "Input");
@@ -19,8 +19,8 @@
//! `olive::CornerPinDistortNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, Gizmo, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -515,12 +515,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -600,7 +600,7 @@ mod tests {
let NodeValue::Texture(handle) = table.get(ValueType::Texture).unwrap() else {
unreachable!()
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("cornerpin output boxes a ShaderJobPayload");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.cornerpin");
assert_eq!(payload.shader_id, "");
+7 -7
View File
@@ -19,8 +19,8 @@
//! `olive::CropDistortNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, Gizmo, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -412,12 +412,12 @@ fn create_crop_side_input(core: &mut NodeCore, id: &str) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -503,7 +503,7 @@ mod tests {
NodeValue::Texture(h) => *h,
_ => panic!("texture expected"),
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle) }
.expect("shader job payload expected");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.crop");
assert_eq!(payload.shader_id, "");
+6 -6
View File
@@ -18,8 +18,8 @@
//! `olive::DespillNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -288,11 +288,11 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = DespillNode;
assert_eq!(n.input_name(TEXTURE_INPUT), "Input");
@@ -358,7 +358,7 @@ mod tests {
panic!("expected a texture-typed value");
};
let payload =
unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("payload boxed behind the handle");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.despill");
assert_eq!(payload.shader_id, "");
@@ -19,8 +19,8 @@
//! `olive::DropShadowFilter`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -369,12 +369,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
+8 -8
View File
@@ -19,8 +19,8 @@
//! `olive::FlipDistortNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -201,12 +201,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -271,7 +271,7 @@ mod tests {
NodeValue::Texture(h) => *h,
_ => panic!("texture expected"),
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle) }
.expect("shader job payload expected");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.flip");
assert_eq!(payload.shader_id, "");
@@ -294,7 +294,7 @@ mod tests {
NodeValue::Texture(h) => *h,
_ => panic!("texture expected"),
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle) }
.expect("shader job payload expected");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.flip");
assert_eq!(payload.iterations, 1);
+10 -10
View File
@@ -22,7 +22,7 @@
//! base texture. Not instantiable, so this is a helper module, not a
//! [`NodeBehavior`] implementation.
use crate::nodes::jobs::ShaderJobPayload;
use crate::jobs::ShaderJobPayload;
use crate::value::NodeValue;
/// Base texture input id (C++ `k_base_input`). Type: texture; flags:
@@ -162,13 +162,13 @@ impl GeneratorWithMerge {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn push_job_without_base_pushes_job_unchanged() {
let job = crate::handle::make_owned(crate::nodes::jobs::ShaderJobPayload {
let job = crate::handle::make_owned(crate::jobs::ShaderJobPayload {
type_id: "org.olivevideoeditor.Olive.solidgenerator".to_string(),
time: Rational::new(2, 1),
shader_id: "1".to_string(),
@@ -185,7 +185,7 @@ mod tests {
_ => panic!("texture expected"),
};
let payload = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle)
}
.expect("job payload boxed");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.solidgenerator");
@@ -210,7 +210,7 @@ mod tests {
#[test]
fn push_job_with_base_boxes_merge_payload() {
let gen_job = crate::handle::make_owned(crate::nodes::jobs::ShaderJobPayload {
let gen_job = crate::handle::make_owned(crate::jobs::ShaderJobPayload {
type_id: "org.olivevideoeditor.Olive.solidgenerator".to_string(),
time: Rational::new(2, 1),
shader_id: "1".to_string(),
@@ -226,7 +226,7 @@ mod tests {
_ => panic!("texture expected"),
};
let merge = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle)
}
.expect("merge job payload boxed");
assert_eq!(merge.shader_id, "mrg");
@@ -240,7 +240,7 @@ mod tests {
_ => panic!("texture expected"),
};
let blend_job = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&blend)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&blend)
}
.expect("blend job payload boxed");
assert_eq!(blend_job.type_id, "org.olivevideoeditor.Olive.solidgenerator");
+6 -6
View File
@@ -424,7 +424,7 @@ impl NodeBehavior for MaskDistortNode {
params.insert(id.to_string(), core.value_at_time(id, -1, time));
}
}
let job = crate::handle::make_owned(crate::nodes::jobs::ShaderJobPayload {
let job = crate::handle::make_owned(crate::jobs::ShaderJobPayload {
node_id: crate::id::NodeId::INVALID,
time,
iterations: 1,
@@ -562,11 +562,11 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = MaskDistortNode {
polygon: crate::nodes::polygon::PolygonGenerator,
@@ -643,7 +643,7 @@ mod tests {
panic!("pushed value is not a texture handle");
};
let job = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle)
}
.expect("real shader job");
assert_eq!(job.shader_id, "mask");
+7 -7
View File
@@ -281,12 +281,12 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn row(values: &[(&str, NodeValue)]) -> crate::value::NodeValueRow {
fn row(values: &[(&str, NodeValue)]) -> crate::value::NodeValueRow {
values
.iter()
.map(|(k, v)| (k.to_string(), v.clone()))
@@ -417,7 +417,7 @@ mod tests {
_ => panic!("texture expected"),
};
let payload = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle)
}
.expect("shader job payload boxed in the pushed texture");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.math");
@@ -453,7 +453,7 @@ mod tests {
_ => panic!("texture expected"),
};
let payload = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle)
};
assert!(payload.is_none(), "no shader job for a null texture");
}
+8 -8
View File
@@ -21,8 +21,8 @@
//! the pairing heuristic, and the static eval/shader helpers shared
//! by `MathNode` (and conceptually other binary math nodes).
use crate::jobs::ShaderJobPayload;
use crate::node::NodeCore;
use crate::nodes::jobs::ShaderJobPayload;
use crate::value::{NodeValue, NodeValueRow, NodeValueTable, ValueType};
/// Binary operation (C++ `MathNodeBase::Operation`).
@@ -980,11 +980,11 @@ impl ValueType {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValueTable, SampleBuffer};
use oak_core::{Rational, SampleFormat};
use super::*;
use crate::value::{NodeValueTable, SampleBuffer};
use oak_core::{Rational, SampleFormat};
fn table(values: Vec<NodeValue>) -> NodeValueTable {
fn table(values: Vec<NodeValue>) -> NodeValueTable {
let mut t = NodeValueTable::default();
for v in values {
let ty = v.value_type();
@@ -1487,7 +1487,7 @@ mod tests {
_ => panic!("texture expected"),
};
let payload = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle)
}
.expect("shader job payload boxed in the pushed texture");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.math");
@@ -1632,8 +1632,8 @@ mod tests {
#[test]
fn value_rational_arithmetic_all_ops() {
use oak_core::Rational;
for (op, a, b, expect) in [
use oak_core::Rational;
for (op, a, b, expect) in [
(
Operation::Add,
Rational::new(1, 2),
+6 -6
View File
@@ -18,8 +18,8 @@
//! `olive::MergeNode`): alpha-over composites two textures.
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Base (background) texture input id (C++ `k_base_in`). Type:
/// texture; flags: not-keyframable.
@@ -217,12 +217,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
-2
View File
@@ -30,7 +30,6 @@ mod dropshadowfilter;
mod flipdistortnode;
mod generatorwithmerge;
pub mod group;
pub mod jobs;
mod mask;
mod math;
mod mathbase;
@@ -70,7 +69,6 @@ mod volume;
mod wavedistortnode;
mod whitebalance;
use crate::factory::NodeMeta;
use crate::node::{NodeBehavior, NodeCore};
/// A no-op behavior for vacant arena slots (graph internal; never
@@ -19,8 +19,8 @@
//! `olive::MosaicFilterNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -216,12 +216,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -279,7 +279,7 @@ mod tests {
panic!("expected a texture-typed value");
};
let payload =
unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("payload boxed behind the handle");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.mosaicfilter");
assert_eq!(payload.shader_id, "");
+8 -8
View File
@@ -18,8 +18,8 @@
//! `olive::NoiseGeneratorNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Base texture input id (C++ `k_base_in`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -221,12 +221,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = NoiseGeneratorNode;
assert_eq!(n.input_name(BASE_INPUT), "Base");
@@ -264,7 +264,7 @@ mod tests {
unreachable!()
};
let job =
unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("noise output boxes a ShaderJobPayload");
assert_eq!(job.type_id, "org.olivevideoeditor.Olive.noise");
assert_eq!(job.shader_id, "");
@@ -288,7 +288,7 @@ mod tests {
unreachable!()
};
let job =
unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("noise output boxes a ShaderJobPayload");
assert_eq!(job.type_id, "org.olivevideoeditor.Olive.noise");
assert!(job.params.contains_key(BASE_INPUT));
@@ -439,7 +439,7 @@ impl NodeBehavior for OCIOGradingTransformLinearNode {
crate::value::NodeValue::Boolean(false),
);
let job = crate::handle::make_owned(crate::nodes::jobs::ShaderJobPayload {
let job = crate::handle::make_owned(crate::jobs::ShaderJobPayload {
node_id: crate::id::NodeId::INVALID,
time,
iterations: 1,
@@ -656,12 +656,12 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::keyframe::{Interpolation, Keyframe};
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::keyframe::{Interpolation, Keyframe};
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn node() -> OCIOGradingTransformLinearNode {
fn node() -> OCIOGradingTransformLinearNode {
OCIOGradingTransformLinearNode {
base: OcioBase::new(),
}
@@ -916,7 +916,7 @@ mod tests {
panic!("pushed value is not a texture handle");
};
let job = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle)
}
.expect("real shader job");
assert_eq!(job.shader_id, "rgb");
@@ -986,7 +986,7 @@ mod tests {
panic!("pushed value is not a texture handle");
};
let job = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle)
}
.expect("real shader job");
// White <= black is raised to black + 0.000001.
@@ -470,7 +470,7 @@ impl NodeBehavior for OCIOGradingTransformLogNode {
crate::value::NodeValue::Boolean(false),
);
let job = crate::handle::make_owned(crate::nodes::jobs::ShaderJobPayload {
let job = crate::handle::make_owned(crate::jobs::ShaderJobPayload {
node_id: crate::id::NodeId::INVALID,
time,
iterations: 1,
@@ -680,12 +680,12 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::keyframe::{Interpolation, Keyframe};
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::keyframe::{Interpolation, Keyframe};
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn node() -> OCIOGradingTransformLogNode {
fn node() -> OCIOGradingTransformLogNode {
OCIOGradingTransformLogNode {
base: OcioBase::new(),
}
@@ -903,7 +903,7 @@ mod tests {
panic!("pushed value is not a texture handle");
};
let job = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle)
}
.expect("real shader job");
assert_eq!(job.shader_id, "rgb");
+6 -6
View File
@@ -18,8 +18,8 @@
//! `olive::OpacityEffect`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -257,12 +257,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = OpacityEffect {
math: super::super::math::MathNode::new(),
+7 -7
View File
@@ -232,7 +232,7 @@ impl NodeBehavior for PolygonGenerator {
core.value_at_time(COLOR_INPUT, -1, time),
);
}
let job = crate::handle::make_owned(crate::nodes::jobs::ShaderJobPayload {
let job = crate::handle::make_owned(crate::jobs::ShaderJobPayload {
node_id: crate::id::NodeId::INVALID,
time,
iterations: 1,
@@ -382,12 +382,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = PolygonGenerator;
assert_eq!(
@@ -440,7 +440,7 @@ mod tests {
panic!("pushed value is not a texture handle");
};
let job = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle)
}
.expect("real shader job");
assert_eq!(job.shader_id, "rgb");
@@ -19,8 +19,8 @@
//! `olive::RippleDistortNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, Gizmo, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -297,12 +297,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -377,7 +377,7 @@ mod tests {
let NodeValue::Texture(handle) = table.get(ValueType::Texture).unwrap() else {
unreachable!()
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("ripple output boxes a ShaderJobPayload");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.ripple");
assert_eq!(payload.shader_id, "");
+6 -6
View File
@@ -20,8 +20,8 @@
//! [`super::generatorwithmerge`]).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Shape type input id (C++ `k_type_input`). Type: combo; prepended
/// ahead of the base inputs; combo strings (matching the C++ `Type`
@@ -371,12 +371,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = ShapeNode;
assert_eq!(n.input_name(TYPE_INPUT), "Type");
+7 -7
View File
@@ -18,8 +18,8 @@
//! `olive::SolidGenerator`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Color input id (C++ `k_color_input`). Type: color; default
/// `(1.0, 0.0, 0.0, 1.0)` (red — "a color that isn't black").
@@ -141,12 +141,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = SolidGenerator;
assert_eq!(n.input_name(COLOR_INPUT), "Color");
@@ -179,7 +179,7 @@ mod tests {
unreachable!()
};
let job = unsafe {
crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle)
crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle)
}
.expect("solid output boxes a ShaderJobPayload");
assert_eq!(
+6 -6
View File
@@ -18,8 +18,8 @@
//! `olive::StrokeFilterNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -297,12 +297,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -19,8 +19,8 @@
//! `olive::SwirlDistortNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, Gizmo, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -271,12 +271,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -362,7 +362,7 @@ mod tests {
let NodeValue::Texture(handle) = table.get(ValueType::Texture).unwrap() else {
unreachable!()
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("swirl output boxes a ShaderJobPayload");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.swirl");
assert_eq!(payload.shader_id, "");
+6 -6
View File
@@ -19,8 +19,8 @@
//! `olive::ThreeWayColorNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -289,11 +289,11 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = ThreeWayColorNode;
assert_eq!(n.input_name(TEXTURE_INPUT), "Input");
@@ -375,7 +375,7 @@ mod tests {
panic!("expected a texture-typed value");
};
let payload =
unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("payload boxed behind the handle");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.threewaycolor");
assert_eq!(payload.shader_id, "");
+7 -7
View File
@@ -19,8 +19,8 @@
//! `olive::TileDistortNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, Gizmo, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -379,12 +379,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -456,7 +456,7 @@ mod tests {
let NodeValue::Texture(handle) = table.get(ValueType::Texture).unwrap() else {
unreachable!()
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("tile output boxes a ShaderJobPayload");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.tile");
assert_eq!(payload.shader_id, "");
@@ -22,8 +22,8 @@
//! and the `generate_matrix` helper.
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, Gizmo, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Parent matrix input id (C++ `k_parent_input`). Type: matrix; no
/// default (identity when unconnected).
@@ -615,12 +615,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -726,7 +726,7 @@ mod tests {
NodeValue::Texture(h) => *h,
_ => panic!("texture expected"),
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(&handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(&handle) }
.expect("shader job payload expected");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.transform");
assert_eq!(payload.shader_id, "");
+7 -7
View File
@@ -19,8 +19,8 @@
//! `olive::WaveDistortNode`).
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -240,12 +240,12 @@ pub fn create() -> (NodeCore, Box<dyn NodeBehavior>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::node::NodeBehavior;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
fn tex() -> NodeValue {
fn tex() -> NodeValue {
NodeValue::Texture(crate::handle::CHandle::null())
}
@@ -315,7 +315,7 @@ mod tests {
let NodeValue::Texture(handle) = table.get(ValueType::Texture).unwrap() else {
unreachable!()
};
let payload = unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
let payload = unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("wave output boxes a ShaderJobPayload");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.wave");
assert_eq!(payload.shader_id, "");
+6 -6
View File
@@ -25,8 +25,8 @@
//! the green-magenta axis.
use crate::factory::NodeMeta;
use crate::jobs::ShaderJobPayload;
use crate::node::{Category, NodeBehavior, NodeCore};
use crate::nodes::jobs::ShaderJobPayload;
/// Texture input id (C++ `k_texture_input`). Type: texture; flags:
/// not-keyframable; this is the node's effect input.
@@ -276,11 +276,11 @@ pub fn register(meta: &mut Vec<NodeMeta>) {
#[cfg(test)]
mod tests {
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
use super::*;
use crate::value::{NodeValue, NodeValueTable, ValueType};
use oak_core::Rational;
#[test]
#[test]
fn input_names() {
let n = WhiteBalanceNode;
assert_eq!(n.input_name(TEXTURE_INPUT), "Input");
@@ -397,7 +397,7 @@ mod tests {
panic!("expected a texture-typed value");
};
let payload =
unsafe { crate::handle::get_checked::<crate::nodes::jobs::ShaderJobPayload>(handle) }
unsafe { crate::handle::get_checked::<crate::jobs::ShaderJobPayload>(handle) }
.expect("payload boxed behind the handle");
assert_eq!(payload.type_id, "org.olivevideoeditor.Olive.whitebalance");
assert_eq!(payload.shader_id, "");
+2 -2
View File
@@ -40,7 +40,7 @@ use oak_core::color::ColorProcessor;
use oak_core::frame::VideoParamsPod;
use oak_core::texture::{Frame, Texture};
use oak_core::{PixelFormat, Rational, TimeRange};
use oak_node::nodes::jobs::{FootageJobPayload, ShaderJobPayload};
use oak_node::jobs::{FootageJobPayload, ShaderJobPayload};
use oak_node::value::{NodeValue, NodeValueRow, NodeValueTable};
/// Static mapping of OCIO-based node shaders to the OCIO function they
@@ -1058,7 +1058,7 @@ fn render_footage_frame_inner(
/// the legacy sRGB working space or when the frame has no pixel data.
fn convert_decoded_to_working(dst: &mut Frame, decoded: &oak_codec::frame::Frame) {
use oak_core::colormath::{source_primaries_from_av, source_transfer_from_av,
WorkingColorSpace,
WorkingColorSpace,
};
if oak_core::color::pipeline_working_space() == WorkingColorSpace::SrgbLegacy {
return;