pub struct VideoFrame(/* private fields */);Expand description
A video frame. Thin wrapper around GenericFrame. Like a frame but has specific video properties.
Implementations§
Source§impl VideoFrame
impl VideoFrame
Sourcepub fn new() -> Result<Self, FfmpegError>
pub fn new() -> Result<Self, FfmpegError>
Creates a new video frame.
Sourcepub fn sample_aspect_ratio(&self) -> Rational
pub fn sample_aspect_ratio(&self) -> Rational
Returns the sample aspect ratio of the frame.
Sourcepub fn set_sample_aspect_ratio(
&mut self,
sample_aspect_ratio: impl Into<Rational>,
)
pub fn set_sample_aspect_ratio( &mut self, sample_aspect_ratio: impl Into<Rational>, )
Sets the sample aspect ratio of the frame.
Sourcepub const fn set_height(&mut self, height: usize)
pub const fn set_height(&mut self, height: usize)
Sets the height of the frame.
Sourcepub const fn is_keyframe(&self) -> bool
pub const fn is_keyframe(&self) -> bool
Returns true if the frame is a keyframe.
Sourcepub const fn pict_type(&self) -> AVPictureType
pub const fn pict_type(&self) -> AVPictureType
Returns the picture type of the frame.
Sourcepub const fn set_pict_type(&mut self, pict_type: AVPictureType)
pub const fn set_pict_type(&mut self, pict_type: AVPictureType)
Sets the picture type of the frame.
Sourcepub fn data(&self, index: usize) -> Option<&[u8]>
pub fn data(&self, index: usize) -> Option<&[u8]>
Returns the data of the frame. By specifying the index of the plane.
Sourcepub fn data_mut(&mut self, index: usize) -> Option<&mut [u8]>
pub fn data_mut(&mut self, index: usize) -> Option<&mut [u8]>
Returns the data of the frame. By specifying the index of the plane.
Sourcepub const fn format(&self) -> AVPixelFormat
pub const fn format(&self) -> AVPixelFormat
Get the pixel format of the frame.
Trait Implementations§
Source§impl Clone for VideoFrame
impl Clone for VideoFrame
Source§fn clone(&self) -> VideoFrame
fn clone(&self) -> VideoFrame
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VideoFrame
impl Debug for VideoFrame
Source§impl Deref for VideoFrame
impl Deref for VideoFrame
Auto Trait Implementations§
impl Freeze for VideoFrame
impl RefUnwindSafe for VideoFrame
impl Send for VideoFrame
impl Sync for VideoFrame
impl Unpin for VideoFrame
impl UnwindSafe for VideoFrame
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