pub struct FrameRate { /* private fields */ }Expand description
A frame rate stored as an exact reduced fraction, e.g. 30000/1001 for 29.97 fps.
Implementations§
Source§impl FrameRate
impl FrameRate
pub fn new(num: u32, den: u32) -> Result<Self>
pub fn num(self) -> u32
pub fn den(self) -> u32
pub fn as_f64(self) -> f64
Sourcepub fn frame_duration(self) -> f64
pub fn frame_duration(self) -> f64
Duration of one frame in seconds.
Sourcepub fn frame_time(self, frame: i64) -> f64
pub fn frame_time(self, frame: i64) -> f64
Presentation time of frame in seconds.
Sourcepub fn is_drop_frame(self) -> bool
pub fn is_drop_frame(self) -> bool
Whether SMPTE drop-frame timecode applies (29.97 and 59.94).
Sourcepub fn samples_per_frame(self, sample_rate: u32) -> f64
pub fn samples_per_frame(self, sample_rate: u32) -> f64
Audio samples per frame at sample_rate (fractional for NTSC rates).
Sourcepub fn frame_start_sample(self, frame: i64, sample_rate: u32) -> i64
pub fn frame_start_sample(self, frame: i64, sample_rate: u32) -> i64
Index of the first audio sample whose time is at or after the start of frame.
Trait Implementations§
impl Copy for FrameRate
impl Eq for FrameRate
impl StructuralPartialEq for FrameRate
Auto Trait Implementations§
impl Freeze for FrameRate
impl RefUnwindSafe for FrameRate
impl Send for FrameRate
impl Sync for FrameRate
impl Unpin for FrameRate
impl UnsafeUnpin for FrameRate
impl UnwindSafe for FrameRate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more