Struct y4m::Decoder
[−]
[src]
pub struct Decoder<'d, R: Read + 'd> { /* fields omitted */ }
YUV4MPEG2 decoder.
Methods
impl<'d, R: Read> Decoder<'d, R>
[src]
fn new(reader: &mut R) -> Result<Decoder<R>, Error>
Create a new decoder instance.
fn read_frame(&mut self) -> Result<Frame, Error>
Iterate over frames, without extra heap allocations. End of input is
indicated by Error::EOF
.
fn get_width(&self) -> usize
Return file width.
fn get_height(&self) -> usize
Return file height.
fn get_framerate(&self) -> Ratio
Return file framerate.
fn get_colorspace(&self) -> Option<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.
fn get_raw_params(&self) -> &[u8]
Return file raw parameters.