pub struct Decoder<R: Read> { /* private fields */ }
Expand description
YUV4MPEG2 decoder.
Implementations§
source§impl<R: Read> Decoder<R>
impl<R: Read> Decoder<R>
sourcepub fn new_with_limits(reader: R, limits: Limits) -> Result<Decoder<R>, Error>
pub fn new_with_limits(reader: R, limits: Limits) -> Result<Decoder<R>, Error>
Create a new decoder instance with custom limits.
sourcepub fn read_frame(&mut self) -> Result<Frame<'_>, Error>
pub fn read_frame(&mut self) -> Result<Frame<'_>, Error>
Iterate over frames. End of input is indicated by Error::EOF
.
sourcepub fn get_height(&self) -> usize
pub fn get_height(&self) -> usize
Return file height.
sourcepub fn get_framerate(&self) -> Ratio
pub fn get_framerate(&self) -> Ratio
Return file framerate.
sourcepub fn get_pixel_aspect(&self) -> Ratio
pub fn get_pixel_aspect(&self) -> Ratio
Return file pixel aspect.
sourcepub fn get_colorspace(&self) -> Colorspace
pub fn get_colorspace(&self) -> Colorspace
Return file colorspace.
NOTE: normally all .y4m should have colorspace param, but there are files encoded without that tag and it’s unclear what should we do in that case. Currently C420 is implied by default as per ffmpeg behavior.
sourcepub fn get_raw_params(&self) -> &[u8] ⓘ
pub fn get_raw_params(&self) -> &[u8] ⓘ
Return file raw parameters.
sourcepub fn get_bit_depth(&self) -> usize
pub fn get_bit_depth(&self) -> usize
Return the bit depth per sample
sourcepub fn get_bytes_per_sample(&self) -> usize
pub fn get_bytes_per_sample(&self) -> usize
Return the number of bytes in a sample
Auto Trait Implementations§
impl<R> RefUnwindSafe for Decoder<R>where R: RefUnwindSafe,
impl<R> Send for Decoder<R>where R: Send,
impl<R> Sync for Decoder<R>where R: Sync,
impl<R> Unpin for Decoder<R>where R: Unpin,
impl<R> UnwindSafe for Decoder<R>where R: UnwindSafe,
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