pub struct VideoFrame {
pub format: PixelFormat,
pub width: u32,
pub height: u32,
pub planes: Vec<Plane>,
pub timestamp: Timestamp,
pub frame_type: FrameType,
pub color_info: ColorInfo,
pub corrupt: bool,
}Expand description
Decoded video frame.
Fields§
§format: PixelFormatPixel format.
width: u32Frame width in pixels.
height: u32Frame height in pixels.
planes: Vec<Plane>Plane data.
timestamp: TimestampPresentation timestamp.
frame_type: FrameTypeFrame type (I/P/B).
color_info: ColorInfoColor information.
corrupt: boolFrame is corrupt (concealment applied).
Implementations§
Source§impl VideoFrame
impl VideoFrame
Sourcepub fn new(format: PixelFormat, width: u32, height: u32) -> Self
pub fn new(format: PixelFormat, width: u32, height: u32) -> Self
Create a new video frame.
Sourcepub fn plane_dimensions(&self, plane_index: usize) -> (u32, u32)
pub fn plane_dimensions(&self, plane_index: usize) -> (u32, u32)
Get plane dimensions.
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Get total frame size in bytes.
Sourcepub fn is_keyframe(&self) -> bool
pub fn is_keyframe(&self) -> bool
Check if frame is a keyframe.
Trait Implementations§
Source§impl Clone for VideoFrame
impl Clone for VideoFrame
Source§fn clone(&self) -> VideoFrame
fn clone(&self) -> VideoFrame
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for VideoFrame
impl RefUnwindSafe for VideoFrame
impl Send for VideoFrame
impl Sync for VideoFrame
impl Unpin for VideoFrame
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more