|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.red5.io.flv.impl.FLVReader
public class FLVReader
A Reader is used to read the contents of a FLV file. NOTE: This class is not implemented as threading-safe. The caller should make sure the threading-safety.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.red5.io.flv.IKeyFrameDataAnalyzer |
---|
IKeyFrameDataAnalyzer.KeyFrameMeta |
Field Summary |
---|
Constructor Summary | |
---|---|
FLVReader(File f)
Creates FLV reader from file input stream. |
|
FLVReader(File f,
boolean generateMetadata)
Creates FLV reader from file input stream, sets up metadata generation flag. |
|
FLVReader(FileChannel channel)
Creates FLV reader from file channel. |
|
FLVReader(IoBuffer buffer,
boolean generateMetadata)
Accepts mapped file bytes to construct internal members. |
Method Summary | |
---|---|
IKeyFrameDataAnalyzer.KeyFrameMeta |
analyzeKeyFrames()
Key frames analysis may be used as a utility method so synchronize it. |
void |
close()
Closes the reader and free any allocated memory. |
void |
decodeHeader()
Decode the header of the stream; |
int |
getAudioCodecId()
|
static int |
getBufferSize()
Getter for buffer size. |
static String |
getBufferType()
Getter for buffer type (auto, direct or heap). |
long |
getBytesRead()
Returns the amount of bytes read |
long |
getDuration()
Return length in seconds |
static int |
getDuration(File flvFile)
Returns the last tag's timestamp as the files duration. |
IStreamableFile |
getFile()
Return the file that is loaded. |
IoBuffer |
getFileData()
Returns the file buffer. |
int |
getOffset()
Returns the offet length |
long |
getTotalBytes()
Get the total readable bytes in a file or ByteBuffer. |
int |
getVideoCodecId()
|
boolean |
hasMoreTags()
Returns a boolean stating whether the FLV has more tags |
boolean |
hasVideo()
Check if the reader also has video tags. |
void |
position(long pos)
Put the current position to pos. |
ITag |
readTag()
Returns a Tag object |
static void |
setBufferSize(int bufferSize)
Setter for property 'bufferSize'. |
static void |
setBufferType(String bufferType)
Setter for buffer type. |
void |
setKeyFrameCache(IKeyFrameMetaCache keyframeCache)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FLVReader(File f) throws IOException
f
- File
IOException
- on errorpublic FLVReader(File f, boolean generateMetadata) throws IOException
f
- File input streamgenerateMetadata
- true
if metadata generation required, false
otherwise
IOException
- on errorpublic FLVReader(FileChannel channel) throws IOException
channel
-
IOException
- on errorpublic FLVReader(IoBuffer buffer, boolean generateMetadata)
generateMetadata
- true
if metadata generation required, false
otherwisebuffer
- IoBufferMethod Detail |
---|
public void setKeyFrameCache(IKeyFrameMetaCache keyframeCache)
public long getTotalBytes()
getTotalBytes
in interface ITagReader
public boolean hasVideo()
hasVideo
in interface ITagReader
public static String getBufferType()
public static void setBufferType(String bufferType)
bufferType
- Value to set for property 'bufferType'public static int getBufferSize()
public static void setBufferSize(int bufferSize)
bufferSize
- Value to set for property 'bufferSize'public IoBuffer getFileData()
public void decodeHeader()
decodeHeader
in interface ITagReader
public IStreamableFile getFile()
getFile
in interface ITagReader
public int getOffset()
getOffset
in interface ITagReader
public long getBytesRead()
getBytesRead
in interface ITagReader
public long getDuration()
getDuration
in interface ITagReader
public int getVideoCodecId()
public int getAudioCodecId()
public boolean hasMoreTags()
hasMoreTags
in interface ITagReader
public ITag readTag()
readTag
in interface ITagReader
public void close()
close
in interface ITagReader
public IKeyFrameDataAnalyzer.KeyFrameMeta analyzeKeyFrames()
analyzeKeyFrames
in interface IKeyFrameDataAnalyzer
public void position(long pos)
position
in interface ITagReader
pos
- New position in file. Pass Long.MAX_VALUE
to seek to end of file.public static int getDuration(File flvFile)
flvFile
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |