mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
feat(context/sink): add time_base getter
Calls `av_buffersink_get_time_base`.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use libc::c_int;
|
||||
|
||||
use super::Context;
|
||||
use crate::{ffi::*, Error, Frame};
|
||||
use crate::{ffi::*, Error, Frame, Rational};
|
||||
|
||||
pub struct Sink<'a> {
|
||||
ctx: &'a mut Context<'a>,
|
||||
@@ -39,4 +39,8 @@ impl<'a> Sink<'a> {
|
||||
av_buffersink_set_frame_size(self.ctx.as_mut_ptr(), value);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn time_base(&self) -> Rational {
|
||||
unsafe { Rational::from(av_buffersink_get_time_base(self.ctx.as_ptr())) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user