Class IVFFileReader
- java.lang.Object
-
- org.jitsi.impl.neomedia.jmfext.media.protocol.ivffile.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 Summary
Constructors Constructor Description IVFFileReader(String filePath)Initialize a new instance of IVFFileReader that will read the IVF file located by filePath.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intchangeEndianness(int value)Change the endianness of a 32bits int.static longchangeEndianness(long value)Change the endianness of a 64bits long.static shortchangeEndianness(short value)Change the endianness of a 16bits short.IVFHeadergetHeader()Get the header of the IVF file.VP8FramegetNextFrame(boolean loopFile)Get the next vp8 frame of the IVF file as a byte array.voidgetNextFrame(VP8Frame frame, boolean loopFile)Get the next vp8 frame of the IVF file as a byte array.
-
-
-
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
-
-