pub fn read_frame(&mut self) -> Result<Option<Frame>> {
        if self.reader.read_exact(&mut self.size_buffer).is_err() {
            return Ok(None);
        }
        if self.reader.read_exact(&mut self.timestamp_buffer).is_err() {
            return Err(IvfError::UnexpectedFileEnding);
        }

        let size = usize::try_from(u32::from_le_bytes(self.size_buffer))?;
        let timestamp = u64::from_le_bytes(self.timestamp_buffer);

        let mut data = vec![0u8; size];

        if self.reader.read_exact(&mut data).is_err() {
            return Err(IvfError::UnexpectedFileEnding);
        }

        Ok(Some(Frame {
            timestamp,
            packet: data,
        }))
    }
/// Reads the next frame inside the IVF. Returns `None` if the end of the file has been reached.
///
/// A frame contains a VP9 bitstream packet which can contain either a normal frame or a super frame.
Reads the next frame inside the IVF. Returns `None` if the end of the file has been reached.
A frame contains a VP9 bitstream packet which can contain either a normal frame or a super frame.
Reads the next frame inside the IVF . Returns ` None ` if the end of the file has been reached . A frame contains a VP9 bitstream packet which can contain either a normal frame or a super frame .
pub fn read_frame(&mut self) -> Result<Option<Frame>> {
        if self.reader.read_exact(&mut self.size_buffer).is_err() {
            return Ok(None);
        }
        if self.reader.read_exact(&mut self.timestamp_buffer).is_err() {
            return Err(IvfError::UnexpectedFileEnding);
        }
        let size = usize::try_from(u32::from_le_bytes(self.size_buffer))?;
        let timestamp = u64::from_le_bytes(self.timestamp_buffer);
        let mut data = vec![0u8; size];
        if self.reader.read_exact(&mut data).is_err() {
            return Err(IvfError::UnexpectedFileEnding);
        }
        Ok(Some(Frame {
            timestamp,
            packet: data,
        }))
    }
pub fn read_frame ( & mut self ) -> Result < Option < Frame > > { if self . reader . read_exact ( & mut self . size_buffer ) . is_err ( ) { return Ok ( None ) ; } if self . reader . read_exact ( & mut self . timestamp_buffer ) . is_err ( ) { return Err ( IvfError :: UnexpectedFileEnding ) ; } let size = usize :: try_from ( u32 :: from_le_bytes ( self . size_buffer ) ) ? ; let timestamp = u64 :: from_le_bytes ( self . timestamp_buffer ) ; let mut data = vec ! [ 0u8 size ] ; if self . reader . read_exact ( & mut data ) . is_err ( ) { return Err ( IvfError :: UnexpectedFileEnding ) ; } Ok ( Some ( Frame { timestamp , packet : data , } ) ) }
Reads the next frame inside the IVF.
Reads the next frame inside the IVF .
&mut self
&mut self