mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-17 08:54:42 +00:00
interchange: adapt export to current Film media and marker APIs
This commit is contained in:
@@ -365,7 +365,7 @@ impl Exporter<'_> {
|
||||
let mut clip = media_clip(fp::MediaRef::File { path: path.clone() }, info);
|
||||
clip.offline = f.missing;
|
||||
let bin = self.bin(it.and_then(|i| i.parent));
|
||||
let id = self.fp.add_item(&name, fp::Label::Iris, fp::ItemKind::Media(clip), bin);
|
||||
let id = self.fp.add_item(&name, fp::Label::Iris, fp::ItemKind::Media(Box::new(clip)), bin);
|
||||
self.media.insert(path, id);
|
||||
id
|
||||
}
|
||||
@@ -384,7 +384,7 @@ impl Exporter<'_> {
|
||||
Some(b)
|
||||
}
|
||||
};
|
||||
let id = self.fp.add_item(name, fp::Label::Violet, fp::ItemKind::Media(clip), bin);
|
||||
let id = self.fp.add_item(name, fp::Label::Violet, fp::ItemKind::Media(Box::new(clip)), bin);
|
||||
self.media.insert(r.path.clone(), id);
|
||||
id
|
||||
}
|
||||
@@ -405,7 +405,7 @@ impl Exporter<'_> {
|
||||
);
|
||||
let clip = media_clip(fp::MediaRef::Generator(Generator::ColorMatte { color: [color[0], color[1], color[2], 1.0] }), info);
|
||||
let bin = self.bin(it.and_then(|i| i.parent));
|
||||
let id = self.fp.add_item(&name, fp::Label::Rose, fp::ItemKind::Media(clip), bin);
|
||||
let id = self.fp.add_item(&name, fp::Label::Rose, fp::ItemKind::Media(Box::new(clip)), bin);
|
||||
self.media.insert(key, id);
|
||||
id
|
||||
}
|
||||
@@ -540,6 +540,9 @@ impl Exporter<'_> {
|
||||
comment: if m.chapter.is_empty() { String::new() } else { m.comment.clone() },
|
||||
kind: if m.chapter.is_empty() { fp::MarkerKind::Comment } else { fp::MarkerKind::Chapter },
|
||||
color: fp::Label::Green,
|
||||
custom_color: None,
|
||||
author: String::new(),
|
||||
url: m.url.clone(),
|
||||
})
|
||||
.collect();
|
||||
if let Some(seq) = self.fp.sequence_mut(sid) {
|
||||
@@ -733,6 +736,7 @@ fn media_info(name: &str, kind: MediaKind, duration: Tick, video: Option<VideoSp
|
||||
codec,
|
||||
pixel_format: String::new(),
|
||||
color: Default::default(),
|
||||
color_assumed: None,
|
||||
has_alpha,
|
||||
bitrate: None,
|
||||
hdr: None,
|
||||
@@ -755,6 +759,15 @@ fn media_clip(media: fp::MediaRef, info: MediaInfo) -> fp::MediaClip {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn synthesized_video_metadata_does_not_claim_an_inferred_color_profile() {
|
||||
let info = media_info("clip", MediaKind::Video, Tick::ZERO, Some((1920, 1080, FrameRate::new(24, 1), 1.0, "raw".into(), true)), false);
|
||||
let video = info.video.unwrap();
|
||||
assert_eq!((video.width, video.height), (1920, 1080));
|
||||
assert!(video.color_assumed.is_none());
|
||||
assert!(video.has_alpha);
|
||||
}
|
||||
|
||||
/// A folder's bin is the same one each time it is asked for (a cached folder once answered
|
||||
/// `None`, so a folder's second item went to the project root); a non-item has no bin.
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user