Skip to content

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

M4.10: merge main

Brandon Thomas8e6b273eba0b
diff --cc crates/codecs/src/video.rs
index 19fdf2968,199230524..57e4339fb
--- a/crates/codecs/src/video.rs
+++ b/crates/codecs/src/video.rs
@@@ -330,9 -336,12 +336,15 @@@ impl VideoDecoder for HevcDecoder
fn is_disposable(&self, sample: &[u8]) -> bool {
hevc_disposable(sample, self.length_size, self.highest_tid)
}
+ fn set_draft(&mut self, on: bool) {
+ self.dec.set_draft(on);
+ }
+ fn is_random_access(&self, sample: &[u8]) -> Option<bool> {
+ // Annex B samples carry their parameter sets: an IDR / CRA / BLA access unit is a
+ // starting point.
+ (self.length_size == 0)
+ .then(|| filmcraft_bitstream::annexb_nals(sample).iter().any(|n| n.first().is_some_and(|h| (16..=21).contains(&((h >> 1) & 0x3F)))))
+ }
}
pub fn hevc_factory(e: &SampleEntry) -> Option<Result<Box<dyn VideoDecoder>>> {