diff --git a/dav1d-sys/build.rs b/dav1d-sys/build.rs index d228929..f5f9bbc 100644 --- a/dav1d-sys/build.rs +++ b/dav1d-sys/build.rs @@ -67,7 +67,7 @@ mod build { runner!("meson", "install", "-C", build_path.to_str().unwrap()); let pkg_dir = build_path.join("meson-private"); - system_deps::Library::from_internal_pkg_config(&pkg_dir, lib, TAG) + system_deps::Library::from_internal_pkg_config(pkg_dir, lib, TAG) } } diff --git a/src/lib.rs b/src/lib.rs index 38fd798..827090d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ use std::fmt; use std::i64; use std::mem; use std::ptr; -use std::sync::Arc; +use std::rc::Rc; /// Error enum return by various `dav1d` operations. #[derive(Debug, Copy, Clone, PartialEq, Eq)] @@ -189,20 +189,15 @@ bitflags::bitflags! { } } -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)] pub enum DecodeFrameType { + #[default] All, Reference, Intra, Key, } -impl Default for DecodeFrameType { - fn default() -> Self { - DecodeFrameType::All - } -} - impl TryFrom for DecodeFrameType { type Error = TryFromEnumError; @@ -418,7 +413,7 @@ impl Decoder { } else { let inner = InnerPicture { pic }; Ok(Picture { - inner: Arc::new(inner), + inner: Rc::new(inner), }) } } @@ -453,7 +448,7 @@ struct InnerPicture { /// A decoded frame. #[derive(Debug, Clone)] pub struct Picture { - inner: Arc, + inner: Rc, } /// Pixel layout of a frame. @@ -561,7 +556,7 @@ impl Picture { PixelLayout::I400 | PixelLayout::I422 | PixelLayout::I444 => self.height(), }, }; - (self.stride(component) as u32, height) + (self.stride(component), height) } /// Plane data of the `component` for the decoded frame. @@ -631,7 +626,7 @@ impl Picture { /// This is the same duration as the one provided to [`Decoder::send_data`] or `0` if none was /// provided. pub fn duration(&self) -> i64 { - self.inner.pic.m.duration as i64 + self.inner.pic.m.duration } /// Offset of the frame.