util/frame: add Frame::aspect_ratio
This commit is contained in:
parent
47f010a3cb
commit
7c213c2516
@ -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<Video> for Frame {
|
||||
|
Loading…
x
Reference in New Issue
Block a user