Class IVFFileReader


  • public class IVFFileReader
    extends Object
    This class represent an IVF file and provide an API to get the vp8 video frames it contains.
    Author:
    Thomas Kuntz
    • Constructor Detail

      • IVFFileReader

        public IVFFileReader​(String filePath)
        Initialize a new instance of IVFFileReader that will read the IVF file located by filePath.
        Parameters:
        filePath - the location of the IVF file this IVFFileReader will read.
    • Method Detail

      • getHeader

        public IVFHeader getHeader()
        Get the header of the IVF file.
        Returns:
        the header of the IVF file represented by a IVFHeader.
      • getNextFrame

        public VP8Frame getNextFrame​(boolean loopFile)
                              throws IOException
        Get the next vp8 frame of the IVF file as a byte array. A VP8Frame is allocated for each call to this function.
        Parameters:
        loopFile - if true and the end of the file is reached, this IVFFileReader will go back at the beginning of the file and start over the reading of the file.
        Returns:
        the next vp8 frame of the IVF file as a byte array.
        Throws:
        IOException - if an error occur during the read, of if EOF is reached.
      • getNextFrame

        public void getNextFrame​(VP8Frame frame,
                                 boolean loopFile)
                          throws IOException
        Get the next vp8 frame of the IVF file as a byte array. You should use this function if you don't want to allocate a new VP8Frame for each call.
        Parameters:
        frame - the VP8Frame that will be filled with the next frame from the file.
        loopFile - if true and the end of the file is reached, this IVFFileReader will go back at the beginning of the file and start over the reading of the file.
        Throws:
        IOException - if an error occur during the read, of if EOF is reached.
      • changeEndianness

        public static int changeEndianness​(int value)
        Change the endianness of a 32bits int.
        Parameters:
        value - the value which you want to change the endianness.
        Returns:
        the value with a changed endianness.
      • changeEndianness

        public static short changeEndianness​(short value)
        Change the endianness of a 16bits short.
        Parameters:
        value - the value which you want to change the endianness.
        Returns:
        the value with a changed endianness
      • changeEndianness

        public static long changeEndianness​(long value)
        Change the endianness of a 64bits long.
        Parameters:
        value - the value which you want to change the endianness.
        Returns:
        the value with a changed endianness