pub struct VideoScaler { /* private fields */ }
Expand description
A scaler is a wrapper around an SwsContext
. Which is used to scale or transform video frames.
Implementations§
Source§impl VideoScaler
impl VideoScaler
Sourcepub fn new(
input_width: i32,
input_height: i32,
incoming_pixel_fmt: AVPixelFormat,
width: i32,
height: i32,
pixel_format: AVPixelFormat,
) -> Result<Self, FfmpegError>
pub fn new( input_width: i32, input_height: i32, incoming_pixel_fmt: AVPixelFormat, width: i32, height: i32, pixel_format: AVPixelFormat, ) -> Result<Self, FfmpegError>
Creates a new Scaler
instance.
Sourcepub const fn pixel_format(&self) -> AVPixelFormat
pub const fn pixel_format(&self) -> AVPixelFormat
Returns the pixel format of the scalar.
Sourcepub fn process<'a>(
&'a mut self,
frame: &VideoFrame,
) -> Result<&'a VideoFrame, FfmpegError>
pub fn process<'a>( &'a mut self, frame: &VideoFrame, ) -> Result<&'a VideoFrame, FfmpegError>
Processes a frame through the scalar.
Trait Implementations§
impl Send for VideoScaler
Safety: Scaler
is safe to send between threads.
Auto Trait Implementations§
impl Freeze for VideoScaler
impl RefUnwindSafe for VideoScaler
impl !Sync for VideoScaler
impl Unpin for VideoScaler
impl UnwindSafe for VideoScaler
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