mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
feat(util/frame): expose duration field
This commit is contained in:
@@ -129,6 +129,23 @@ impl Frame {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn duration(&self) -> Option<i64> {
|
||||
unsafe {
|
||||
match (*self.as_ptr()).duration {
|
||||
0 => None,
|
||||
d => Some(d),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_duration(&mut self, value: Option<i64>) {
|
||||
unsafe {
|
||||
(*self.as_mut_ptr()).duration = value.unwrap_or(0);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn quality(&self) -> usize {
|
||||
unsafe { (*self.as_ptr()).quality as usize }
|
||||
|
||||
Reference in New Issue
Block a user