diff --git a/src/util/frame/mod.rs b/src/util/frame/mod.rs index 5dcf75f..03e2f31 100644 --- a/src/util/frame/mod.rs +++ b/src/util/frame/mod.rs @@ -7,7 +7,7 @@ use std::mem; use std::ops::Deref; use ffi::*; -use ::{Dictionary, ColorSpace, ColorRange}; +use ::{Dictionary, ColorSpace, ColorRange, Rational}; use ::util::pixel_format::PixelFormat; use ::util::sample_format::SampleFormat; use ::picture; @@ -299,6 +299,12 @@ impl Video { av_frame_set_color_range(self.0.ptr, value.into()); } } + + pub fn aspect_ratio(&self) -> Rational { + unsafe { + Rational((*self.0.ptr).sample_aspect_ratio) + } + } } impl Into