codec/decoder: add frame_rate accessor
This commit is contained in:
parent
22e98c30a9
commit
a5df1a3a60
@ -98,6 +98,19 @@ impl Decoder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn frame_rate(&self) -> Option<Rational> {
|
||||||
|
unsafe {
|
||||||
|
let value = (*self.ptr).framerate;
|
||||||
|
|
||||||
|
if value == (AVRational { num: 0, den: 1 }) {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Some(Rational(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn time_base(&self) -> Rational {
|
pub fn time_base(&self) -> Rational {
|
||||||
unsafe {
|
unsafe {
|
||||||
Rational((*self.ptr).time_base)
|
Rational((*self.ptr).time_base)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user