Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

Refactor export for strict Clippy checks

Dylan M. Taylor343ce0503f2e
diff --git a/crates/export/src/convert.rs b/crates/export/src/convert.rs
index 3faae4c3c..55cbe3065 100644
--- a/crates/export/src/convert.rs
+++ b/crates/export/src/convert.rs
@@ -1,21 +1,32 @@
-use super::*;
+use super::{ExportError, IndexedParallelIterator, ParallelIterator, ParallelSliceMut, Result};
+
+/// A YUV matrix's luma coefficients: `kr` for red and `kb` for blue (green is the remainder).
+#[derive(Clone, Copy, Debug)]
+pub struct Matrix {
+ pub kr: f32,
+ pub kb: f32,
+}
+
+impl Matrix {
+ pub const fn new(kr: f32, kb: f32) -> Self {
+ Self { kr, kb }
+ }
+}
+
+/// The 10-bit 4:4:4 output planes of [`to_yuv444_10`]; `alpha` is filled when present.
+pub struct Planes444<'a> {
+ pub y: &'a mut [u16],
+ pub cb: &'a mut [u16],
+ pub cr: &'a mut [u16],
+ pub alpha: Option<&'a mut [u16]>,
+}
/// Limited-range 10-bit 4:4:4 with matrix (Kr, Kb) from straight RGBA8, or from encoded R'G'B'
/// floats (3 per pixel) when `hdr` is given. `alpha` (full range, 0 = transparent) takes the
/// RGBA8 alpha; it stays opaque for float input, which carries none.
-#[allow(clippy::too_many_arguments)]
-pub fn to_yuv444_10(
- rgba: &[u8],
- hdr: Option<&[f32]>,
- w: usize,
- h: usize,
- kr: f32,
- kb: f32,
- y: &mut [u16],
- cb: &mut [u16],
- cr: &mut [u16],
- alpha: Option<&mut [u16]>,
-) {
+pub fn to_yuv444_10(rgba: &[u8], hdr: Option<&[f32]>, w: usize, h: usize, m: Matrix, planes: Planes444<'_>) {
+ let Matrix { kr, kb } = m;
+ let Planes444 { y, cb, cr, alpha } = planes;
let (w, n) = (w.max(1), w.saturating_mul(h));
let kg = 1.0 - kr - kb;
let (sb, sr) = (2.0 * (1.0 - kb), 2.0 * (1.0 - kr));
@@ -68,8 +79,8 @@ pub fn rgba_to_yuv422_10(rgba: &[u8], w: usize, h: usize, y: &mut [u16], cb: &mu
}
/// Limited-range 10-bit 4:2:2 from encoded R'G'B' floats with matrix (Kr, Kb).
-#[allow(clippy::too_many_arguments)]
-pub fn rgbf_to_yuv422_10(rgb: &[f32], w: usize, h: usize, kr: f32, kb: f32, y: &mut [u16], cb: &mut [u16], cr: &mut [u16]) {
+pub fn rgbf_to_yuv422_10(rgb: &[f32], w: usize, h: usize, m: Matrix, y: &mut [u16], cb: &mut [u16], cr: &mut [u16]) {
+ let Matrix { kr, kb } = m;
let cw = w.div_ceil(2);
debug_assert!(rgb.len() >= w * h * 3 && y.len() >= w * h);
let kg = 1.0 - kr - kb;
@@ -169,8 +180,8 @@ pub fn rgba_to_yuv420_8(rgba: &[u8], w: usize, h: usize, y: &mut Vec<u8>, u: &mu
}
/// Limited-range 8-bit 4:2:0 from encoded R'G'B' floats with matrix (Kr, Kb).
-#[allow(clippy::too_many_arguments)]
-pub fn rgbf_to_yuv420_8(rgb: &[f32], w: usize, h: usize, kr: f32, kb: f32, y: &mut Vec<u8>, u: &mut Vec<u8>, v: &mut Vec<u8>) {
+pub fn rgbf_to_yuv420_8(rgb: &[f32], w: usize, h: usize, m: Matrix, y: &mut Vec<u8>, u: &mut Vec<u8>, v: &mut Vec<u8>) {
+ let Matrix { kr, kb } = m;
let (cw, ch) = (w.div_ceil(2), h.div_ceil(2));
let kg = 1.0 - kr - kb;
let (sb, sr) = (2.0 * (1.0 - kb), 2.0 * (1.0 - kr));
@@ -208,8 +219,8 @@ pub fn rgbf_to_yuv420_8(rgb: &[f32], w: usize, h: usize, kr: f32, kb: f32, y: &m
/// (so black is 64, peak white 940 and the chroma of any colour stays within 64..960).
/// The planes are resized to `w * h` and `ceil(w / 2) * ceil(h / 2)`. A `rgb` slice of the wrong
/// length, a zero size or a size whose arithmetic overflows is an error.
-#[allow(clippy::too_many_arguments)]
-pub fn rgbf_to_yuv420_10(rgb: &[f32], w: usize, h: usize, kr: f32, kb: f32, y: &mut Vec<u16>, u: &mut Vec<u16>, v: &mut Vec<u16>) -> Result<()> {
+pub fn rgbf_to_yuv420_10(rgb: &[f32], w: usize, h: usize, m: Matrix, y: &mut Vec<u16>, u: &mut Vec<u16>, v: &mut Vec<u16>) -> Result<()> {
+ let Matrix { kr, kb } = m;
let bad = || ExportError::Encode(format!("a {w}x{h} HDR picture needs w*h*3 floats, got {}", rgb.len()));
let px = w.checked_mul(h).ok_or_else(bad)?;
if w == 0 || h == 0 || px.checked_mul(3) != Some(rgb.len()) {
diff --git a/crates/export/src/encoders.rs b/crates/export/src/encoders.rs
index 1a49cc542..e66bc500c 100644
--- a/crates/export/src/encoders.rs
+++ b/crates/export/src/encoders.rs
@@ -1,8 +1,9 @@
-use super::convert::{rgba_to_yuv420_8, rgba_to_yuv422_10, rgbf_to_yuv420_8, rgbf_to_yuv422_10, to_yuv444_10};
+use super::convert::{Matrix, Planes444, rgba_to_yuv420_8, rgba_to_yuv422_10, rgbf_to_yuv420_8, rgbf_to_yuv422_10, to_yuv444_10};
use super::format::{ColorSignal, DEFAULT_CRF, ExportSettings, Format, H264Pass};
use super::registry::{AudioEncoder, EncodedPacket, EncoderFrame, PrepareAhead, VideoEncoder};
use super::stats::{Stage, timed};
-use super::*;
+use super::{BitrateMode, ExportError, FrameRate, H264Profile, Result, SampleEntry, SampleFormat};
+use std::sync::{Arc, Mutex, PoisonError};
struct MjpegEncoder {
w: u16,
@@ -152,11 +153,11 @@ impl VideoEncoder for ProResEncoder {
timed(Stage::Convert, || match (chroma, f.hdr) {
(filmcraft_prores::ChromaFormat::Yuv444, hdr) => {
let (kr, kb) = if hdr.is_some() { self.signal.kr_kb() } else { (0.2126, 0.0722) };
- to_yuv444_10(f.rgba, hdr, w, h, kr, kb, &mut fr.y, &mut fr.cb, &mut fr.cr, fr.alpha.as_deref_mut())
+ to_yuv444_10(f.rgba, hdr, w, h, Matrix::new(kr, kb), Planes444 { y: &mut fr.y, cb: &mut fr.cb, cr: &mut fr.cr, alpha: fr.alpha.as_deref_mut() })
}
(_, Some(rgb)) => {
let (kr, kb) = self.signal.kr_kb();
- rgbf_to_yuv422_10(rgb, w, h, kr, kb, &mut fr.y, &mut fr.cb, &mut fr.cr)
+ rgbf_to_yuv422_10(rgb, w, h, Matrix::new(kr, kb), &mut fr.y, &mut fr.cb, &mut fr.cr)
}
(_, None) => rgba_to_yuv422_10(f.rgba, w, h, &mut fr.y, &mut fr.cb, &mut fr.cr),
});
@@ -230,7 +231,7 @@ impl VideoEncoder for DnxEncoder {
match f.hdr {
Some(rgb) => {
let (kr, kb) = self.signal.kr_kb();
- rgbf_to_yuv422_10(rgb, f.width as usize, f.height as usize, kr, kb, &mut fr.y, &mut fr.cb, &mut fr.cr)
+ rgbf_to_yuv422_10(rgb, f.width as usize, f.height as usize, Matrix::new(kr, kb), &mut fr.y, &mut fr.cb, &mut fr.cr)
}
None => rgba_to_yuv422_10(f.rgba, f.width as usize, f.height as usize, &mut fr.y, &mut fr.cb, &mut fr.cr),
}
@@ -298,7 +299,7 @@ impl VideoEncoder for ApvEncoder {
match f.hdr {
Some(rgb) => {
let (kr, kb) = self.signal.kr_kb();
- rgbf_to_yuv422_10(rgb, w, h, kr, kb, &mut y422, &mut cb422, &mut cr422);
+ rgbf_to_yuv422_10(rgb, w, h, Matrix::new(kr, kb), &mut y422, &mut cb422, &mut cr422);
}
None => rgba_to_yuv422_10(f.rgba, w, h, &mut y422, &mut cb422, &mut cr422),
}
@@ -370,7 +371,7 @@ fn h264_input(f: &EncoderFrame, signal: ColorSignal, y: &mut Vec<u8>, u: &mut Ve
match f.hdr {
Some(rgb) => {
let (kr, kb) = signal.kr_kb();
- rgbf_to_yuv420_8(rgb, f.width as usize, f.height as usize, kr, kb, y, u, v)
+ rgbf_to_yuv420_8(rgb, f.width as usize, f.height as usize, Matrix::new(kr, kb), y, u, v)
}
None => rgba_to_yuv420_8(f.rgba, f.width as usize, f.height as usize, y, u, v),
}
diff --git a/crates/export/src/format.rs b/crates/export/src/format.rs
index c9015e0ff..72894c59b 100644
--- a/crates/export/src/format.rs
+++ b/crates/export/src/format.rs
@@ -1,6 +1,9 @@
use super::output::OutputSink;
use super::run::validate_range;
-use super::*;
+use super::{
+ Arc, AudioCodec, AudioSettings, BitrateMode, Deserialize, ExportEffects, ExportError, ExportMetadata, ExrCompression, FieldOrder, FrameRate, GpuRendering,
+ H264Profile, HardwareEncoding, Multiplexer, MxfVideoCodec, Result, SampleEntry, Scaling, Serialize, Tick, TimeRange,
+};
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Format {
diff --git a/crates/export/src/hdr_tests.rs b/crates/export/src/hdr_tests.rs
index 20643314f..3fdaa4901 100644
--- a/crates/export/src/hdr_tests.rs
+++ b/crates/export/src/hdr_tests.rs
@@ -7,7 +7,7 @@ const BT2020: (f32, f32) = (0.2627, 0.0593);
fn convert(rgb: &[f32], w: usize, h: usize) -> (Vec<u16>, Vec<u16>, Vec<u16>) {
let (mut y, mut u, mut v) = (Vec::new(), Vec::new(), Vec::new());
- rgbf_to_yuv420_10(rgb, w, h, BT2020.0, BT2020.1, &mut y, &mut u, &mut v).unwrap();
+ rgbf_to_yuv420_10(rgb, w, h, Matrix::new(BT2020.0, BT2020.1), &mut y, &mut u, &mut v).unwrap();
(y, u, v)
}
@@ -87,7 +87,7 @@ fn a_ramp_has_every_code_a_10_bit_picture_can_have() {
#[test]
fn hostile_input_is_an_error_not_a_panic() {
let (mut y, mut u, mut v) = (Vec::new(), Vec::new(), Vec::new());
- let mut run = |rgb: &[f32], w: usize, h: usize| rgbf_to_yuv420_10(rgb, w, h, 0.2627, 0.0593, &mut y, &mut u, &mut v);
+ let mut run = |rgb: &[f32], w: usize, h: usize| rgbf_to_yuv420_10(rgb, w, h, Matrix::new(0.2627, 0.0593), &mut y, &mut u, &mut v);
assert!(run(&[], 0, 0).is_err());
assert!(run(&[0.0; 3], 0, 1).is_err());
assert!(run(&[0.0; 3], 1, 0).is_err());
diff --git a/crates/export/src/lib.rs b/crates/export/src/lib.rs
index 24e450f3f..1871db835 100644
--- a/crates/export/src/lib.rs
+++ b/crates/export/src/lib.rs
@@ -53,7 +53,7 @@ mod run;
mod stats;
mod still_encode;
-pub use convert::{rgba_to_yuv420_8, rgba_to_yuv422_10, rgbf_to_yuv420_8, rgbf_to_yuv420_10, rgbf_to_yuv422_10, to_yuv444_10};
+pub use convert::{Matrix, Planes444, rgba_to_yuv420_8, rgba_to_yuv422_10, rgbf_to_yuv420_8, rgbf_to_yuv420_10, rgbf_to_yuv422_10, to_yuv444_10};
pub(crate) use encoders::FlacAudio;
#[cfg(test)]
use encoders::{aac_factory, h264_factory};
diff --git a/crates/export/src/mxf_tests.rs b/crates/export/src/mxf_tests.rs
index 6fc4ac54a..419dd62e8 100644
--- a/crates/export/src/mxf_tests.rs
+++ b/crates/export/src/mxf_tests.rs
@@ -24,7 +24,7 @@ fn project() -> (Arc<Project>, ItemId, SourceMap) {
p.add_item(
&info.name.clone(),
Label::Iris,
- ItemKind::Media(MediaClip {
+ ItemKind::Media(Box::new(MediaClip {
media: MediaRef::Generator(g.generator.clone()),
info,
interpret: Default::default(),
@@ -34,7 +34,7 @@ fn project() -> (Arc<Project>, ItemId, SourceMap) {
offline: false,
proxy: None,
identity: None,
- }),
+ })),
None,
)
};
diff --git a/crates/export/src/output.rs b/crates/export/src/output.rs
index 5e17354a1..803ce8c0c 100644
--- a/crates/export/src/output.rs
+++ b/crates/export/src/output.rs
@@ -1,5 +1,5 @@
use super::format::ExportSettings;
-use super::*;
+use super::{Arc, ExportError, Mutex, PoisonError, Result, Write, pcm};
/// Receives in-memory export output: `(path, bytes)` per finished file.
#[derive(Clone)]
diff --git a/crates/export/src/registry.rs b/crates/export/src/registry.rs
index fe762db35..315078645 100644
--- a/crates/export/src/registry.rs
+++ b/crates/export/src/registry.rs
@@ -1,8 +1,10 @@
+#[cfg(test)]
+use super::Ordering;
use super::encoders::{aac_factory, apv_factory, dnx_factory, h264_factory, mjpeg_factory, prores_factory};
use super::format::{ExportSettings, Format};
#[cfg(test)]
use super::stats::{GPU_FALLBACKS, GPU_FRAMES};
-use super::*;
+use super::{FrameRate, ItemId, OnceLock, PoisonError, Project, Result, RwLock, SampleEntry, SourceProvider, Tick};
/// A packet produced by a video encoder.
pub struct EncodedPacket {
diff --git a/crates/export/src/run.rs b/crates/export/src/run.rs
index 0cf8c200b..96e05a8c0 100644
--- a/crates/export/src/run.rs
+++ b/crates/export/src/run.rs
@@ -1,7 +1,10 @@
use super::format::{ExportSettings, Format};
use super::output::{AudioWriter, Out, SharedBuf, write_output};
use super::still_encode::encode_still_with;
-use super::*;
+use super::{
+ Arc, ExportError, Exporter, FrameRate, IntoParallelIterator, ItemId, Ordering, ParallelIterator, PoisonError, Progress, Project, Report, Result,
+ SourceProvider, Step, Tick, TimeRange, Write, aac_out, audio_out, pcm, pipeline, stepped,
+};
/// The range to export (settings → In/Out → whole sequence).
pub fn export_range(project: &Project, seq: ItemId, settings: &ExportSettings) -> Result<TimeRange> {
diff --git a/crates/export/src/settings_tests.rs b/crates/export/src/settings_tests.rs
index cfd028bf8..582ca968b 100644
--- a/crates/export/src/settings_tests.rs
+++ b/crates/export/src/settings_tests.rs
@@ -45,7 +45,7 @@ fn matte(color: [f32; 4], w: u32, h: u32, tone_db: Option<f32>) -> (Arc<Project>
let id = p.add_item(
&info.name.clone(),
Label::Iris,
- ItemKind::Media(MediaClip {
+ ItemKind::Media(Box::new(MediaClip {
media: MediaRef::Generator(g.generator.clone()),
info,
interpret: Default::default(),
@@ -55,7 +55,7 @@ fn matte(color: [f32; 4], w: u32, h: u32, tone_db: Option<f32>) -> (Arc<Project>
offline: false,
proxy: None,
identity: None,
- }),
+ })),
None,
);
m.0.insert(id, Arc::new(g) as Arc<dyn MediaSource>);
@@ -328,15 +328,27 @@ fn aac_audio_writes_m4a_and_adts() {
let (p, seq, m) = matte([0.0, 0.0, 0.0, 1.0], 64, 36, Some(-6.0));
let dir = Scratch::new("aac-audio");
let range = Some(TimeRange::new(Tick::ZERO, Tick(TICKS_PER_SECOND)));
- // .m4a: one AAC track, no video, the encoder delay in an edit list
let m4a = dir.path("a.m4a");
- let s = ExportSettings { format: Format::Aac, path: m4a.clone(), range, ..Default::default() };
- assert!(!s.has_video());
- assert_eq!(s.audio_codec(), AudioCodec::Aac);
- assert_eq!(s.extension(), "m4a");
- let r = export(&p, seq, &s, &m, &Progress::default()).unwrap();
- assert_eq!(r.frames, 48_000, "one second of samples");
- let bytes = std::fs::read(&m4a).unwrap();
+ write_and_check_m4a_aac(&p, seq, &m, &m4a, range);
+
+ let adts = dir.path("a.aac");
+ write_and_check_adts_aac(&p, seq, &m, &adts, range);
+ if let Some(ffmpeg) = filmcraft_testkit::ffmpeg_or_skip("AAC Audio decode") {
+ for path in [&m4a, &adts] {
+ let out = std::process::Command::new(&ffmpeg).args(["-v", "error", "-xerror", "-i", path, "-f", "null", "-"]).output().unwrap();
+ assert!(out.status.success() && out.stderr.is_empty(), "{path}: {}", String::from_utf8_lossy(&out.stderr));
+ }
+ }
+}
+
+fn write_and_check_m4a_aac(p: &Arc<Project>, seq: ItemId, sources: &SourceMap, path: &str, range: Option<TimeRange>) {
+ let settings = ExportSettings { format: Format::Aac, path: path.to_owned(), range, ..Default::default() };
+ assert!(!settings.has_video());
+ assert_eq!(settings.audio_codec(), AudioCodec::Aac);
+ assert_eq!(settings.extension(), "m4a");
+ let report = export(p, seq, &settings, sources, &Progress::default()).unwrap();
+ assert_eq!(report.frames, 48_000, "one second of samples");
+ let bytes = std::fs::read(path).unwrap();
let file = filmcraft_isobmff::open(bytes.clone()).unwrap();
assert_eq!(file.tracks.len(), 1, "audio only");
let t = &file.tracks[0];
@@ -352,7 +364,7 @@ fn aac_audio_writes_m4a_and_adts() {
}
// the -6 dBFS tone (RMS about 0.35) survives the round trip
assert!((0.2..0.5).contains(&rms(&pcm)), "rms {}", rms(&pcm));
- if let Some(j) = ffprobe_json(&["-show_streams", "-show_format"], &m4a) {
+ if let Some(j) = ffprobe_json(&["-show_streams", "-show_format"], path) {
assert_eq!(j["streams"].as_array().unwrap().len(), 1);
let st = &j["streams"][0];
assert_eq!(st["codec_name"], "aac");
@@ -361,13 +373,13 @@ fn aac_audio_writes_m4a_and_adts() {
let d: f64 = j["format"]["duration"].as_str().unwrap().parse().unwrap();
assert!((d - 1.0).abs() < 0.03, "duration {d}");
}
+}
- // .aac: raw ADTS, mono 44.1 kHz at 128 kbps
- let adts = dir.path("a.aac");
- let mut s = ExportSettings { format: Format::Aac, path: adts.clone(), range, ..Default::default() };
- s.audio = AudioSettings { sample_rate: Some(44_100), channels: 1, bitrate_kbps: 128, ..Default::default() };
- export(&p, seq, &s, &m, &Progress::default()).unwrap();
- let b = std::fs::read(&adts).unwrap();
+fn write_and_check_adts_aac(p: &Arc<Project>, seq: ItemId, sources: &SourceMap, path: &str, range: Option<TimeRange>) {
+ let mut settings = ExportSettings { format: Format::Aac, path: path.to_owned(), range, ..Default::default() };
+ settings.audio = AudioSettings { sample_rate: Some(44_100), channels: 1, bitrate_kbps: 128, ..Default::default() };
+ export(p, seq, &settings, sources, &Progress::default()).unwrap();
+ let b = std::fs::read(path).unwrap();
// AAC-LC 44.1 kHz (index 4) mono: 00010 0100 0001 000
let mut dec = filmcraft_aac::Decoder::new(&[0x12, 0x08]).unwrap();
let (mut pos, mut units, mut pcm) = (0usize, 0usize, vec![Vec::new()]);
@@ -384,19 +396,13 @@ fn aac_audio_writes_m4a_and_adts() {
}
assert!(units >= 44_100 / 1024, "{units} frames");
assert!((0.2..0.5).contains(&rms(&pcm)), "rms {}", rms(&pcm));
- if let Some(j) = ffprobe_json(&["-show_streams", "-show_format"], &adts) {
+ if let Some(j) = ffprobe_json(&["-show_streams", "-show_format"], path) {
assert_eq!(j["format"]["format_name"], "aac");
let st = &j["streams"][0];
assert_eq!(st["codec_name"], "aac");
assert_eq!(st["sample_rate"], "44100");
assert_eq!(st["channels"], 1);
}
- if let Some(ffmpeg) = filmcraft_testkit::ffmpeg_or_skip("AAC Audio decode") {
- for f in [&m4a, &adts] {
- let out = std::process::Command::new(&ffmpeg).args(["-v", "error", "-xerror", "-i", f, "-f", "null", "-"]).output().unwrap();
- assert!(out.status.success() && out.stderr.is_empty(), "{f}: {}", String::from_utf8_lossy(&out.stderr));
- }
- }
}
#[test]
diff --git a/crates/export/src/stats.rs b/crates/export/src/stats.rs
index 549b15b21..42238f3a6 100644
--- a/crates/export/src/stats.rs
+++ b/crates/export/src/stats.rs
@@ -1,4 +1,4 @@
-use super::*;
+use super::Ordering;
/// Hardware encoder counters (`perf.stats` `export.hardware`): pictures encoded by hardware
/// encoders, encoders created, and requests a hardware encoder declined (the software encoder
diff --git a/crates/export/src/still_encode.rs b/crates/export/src/still_encode.rs
index bcab9c76b..c2e49eef3 100644
--- a/crates/export/src/still_encode.rs
+++ b/crates/export/src/still_encode.rs
@@ -1,5 +1,5 @@
use super::format::{ExportSettings, Format};
-use super::*;
+use super::{ExportError, ExrCompression, Result, raster};
/// Encode straight sRGB RGBA8 pixels as a PNG file (thumbnails, previews).
pub fn encode_png(rgba: Vec<u8>, w: u32, h: u32) -> Result<Vec<u8>> {
diff --git a/crates/export/src/surround_tests.rs b/crates/export/src/surround_tests.rs
index 890e9131f..173de5987 100644
--- a/crates/export/src/surround_tests.rs
+++ b/crates/export/src/surround_tests.rs
@@ -54,7 +54,7 @@ fn surround() -> (Arc<Project>, ItemId, SourceMap) {
let id = p.add_item(
"tones51",
Label::Iris,
- ItemKind::Media(MediaClip {
+ ItemKind::Media(Box::new(MediaClip {
media: MediaRef::File { path: "/tones51.wav".into() },
info: info.clone(),
interpret: Default::default(),
@@ -64,7 +64,7 @@ fn surround() -> (Arc<Project>, ItemId, SourceMap) {
offline: false,
proxy: None,
identity: None,
- }),
+ })),
None,
);
let r = FrameRate::FPS_24;
diff --git a/crates/export/src/tests.rs b/crates/export/src/tests.rs
index b81444163..305e931d2 100644
--- a/crates/export/src/tests.rs
+++ b/crates/export/src/tests.rs
@@ -14,7 +14,7 @@ pub(crate) fn project() -> (Arc<Project>, ItemId, SourceMap) {
p.add_item(
&info.name.clone(),
Label::Iris,
- ItemKind::Media(MediaClip {
+ ItemKind::Media(Box::new(MediaClip {
media: MediaRef::Generator(g.generator.clone()),
info,
interpret: Default::default(),
@@ -24,7 +24,7 @@ pub(crate) fn project() -> (Arc<Project>, ItemId, SourceMap) {
offline: false,
proxy: None,
identity: None,
- }),
+ })),
None,
)
};
@@ -230,7 +230,7 @@ fn caption_burn_in_h264_ffmpeg_oracle() {
let matte = p.add_item(
"matte",
Label::Iris,
- ItemKind::Media(MediaClip {
+ ItemKind::Media(Box::new(MediaClip {
media: MediaRef::Generator(g.generator.clone()),
info,
interpret: Default::default(),
@@ -240,7 +240,7 @@ fn caption_burn_in_h264_ffmpeg_oracle() {
offline: false,
proxy: None,
identity: None,
- }),
+ })),
None,
);
let r = FrameRate::FPS_24;
@@ -400,7 +400,7 @@ fn gpu_hook_scenarios() {
let red = p.add_item(
&info.name.clone(),
Label::Iris,
- ItemKind::Media(MediaClip {
+ ItemKind::Media(Box::new(MediaClip {
media: MediaRef::Generator(g.generator.clone()),
info,
interpret: Default::default(),
@@ -410,7 +410,7 @@ fn gpu_hook_scenarios() {
offline: false,
proxy: None,
identity: None,
- }),
+ })),
None,
);
let seq = p.new_sequence("s", SequenceSettings { width: w, height: h, frame_rate: FrameRate::FPS_24, ..Default::default() }, 1, 1, None);
diff --git a/crates/export/tests/it/pool_trim.rs b/crates/export/tests/it/pool_trim.rs
index 832888e78..e572d15d8 100644
--- a/crates/export/tests/it/pool_trim.rs
+++ b/crates/export/tests/it/pool_trim.rs
@@ -30,7 +30,7 @@ fn project() -> (Arc<Project>, ItemId, SourceMap) {
proxy: None,
identity: None,
};
- let red = p.add_item(&info.name, Label::Iris, ItemKind::Media(clip), None);
+ let red = p.add_item(&info.name, Label::Iris, ItemKind::Media(Box::new(clip)), None);
let seq = p.new_sequence("s", SequenceSettings { width: 320, height: 180, frame_rate: rate, ..Default::default() }, 1, 1, None);
let item = p.make_track_item(red, TrackKind::Video, Tick::ZERO, TimeRange::new(Tick::ZERO, rate.tick_of(24)), rate).unwrap();
p.sequence_mut(seq).unwrap().video_tracks[0].items.push(item);
diff --git a/crates/export/tests/it/renderer_reentrancy.rs b/crates/export/tests/it/renderer_reentrancy.rs
index 2c3a8bd8a..1b42606a0 100644
--- a/crates/export/tests/it/renderer_reentrancy.rs
+++ b/crates/export/tests/it/renderer_reentrancy.rs
@@ -54,7 +54,7 @@ fn project() -> (Arc<Project>, ItemId, SourceMap) {
let id = project.add_item(
&info.name.clone(),
Label::Iris,
- ItemKind::Media(MediaClip {
+ ItemKind::Media(Box::new(MediaClip {
media: MediaRef::Generator(source.generator.clone()),
info,
interpret: Default::default(),
@@ -64,7 +64,7 @@ fn project() -> (Arc<Project>, ItemId, SourceMap) {
offline: false,
proxy: None,
identity: None,
- }),
+ })),
None,
);
let item = project.make_track_item(id, kind, Tick::ZERO, TimeRange::new(Tick::ZERO, duration), rate).unwrap();