Package org.red5.io.flv.impl
Class FLV
java.lang.Object
org.red5.io.flv.impl.FLV
- All Implemented Interfaces:
IFLV
,IStreamableFile
A FLVImpl implements the FLV api
- Author:
- The Red5 Project, Dominick Accattato (daccattato@gmail.com), Luke Hubbard, Codegent Ltd (luke@codegent.com), Paul Gregoire (mondain@gmail.com)
-
Field Summary
Modifier and TypeFieldDescriptionprivate static ICacheStore
private File
private boolean
protected static org.slf4j.Logger
private IMetaData<?,
?> private IMetaService
private static LinkedList<Class<IPostProcessor>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Flushes HeaderReturns a Writer which is setup to append to the file.Gets the keyframe dataReturns a map of the metadataReturns a reader to parse and read the tags inside the file.Returns a writer that creates a new file or truncates existing contents.boolean
Returns a boolean stating whether a flv has keyframedataboolean
Returns a boolean stating whether the flv has metadatareaderFromNearestKeyFrame
(int seekPoint) Returns a Reader closest to the nearest keyframevoid
Refreshes the headers.void
setCache
(ICacheStore cache) Sets the cache implementation to be used.void
setKeyFrameData
(Map keyframedata) Sets the keyframe data of a flv filevoid
setMetaData
(IMetaData meta) Sets the metadatavoid
setMetaService
(IMetaService service) Sets the MetaService through Springvoid
setWriterPostProcessor
(String writerPostProcessor) Sets a writer post processor.void
setWriterPostProcessors
(Set<String> writerPostProcessors) Sets a group of writer post processors.writerFromNearestKeyFrame
(int seekPoint) Returns a Writer based on the nearest key frame
-
Field Details
-
log
protected static org.slf4j.Logger log -
cache
-
writePostProcessors
-
file
-
generateMetadata
private boolean generateMetadata -
metaService
-
metaData
-
-
Constructor Details
-
FLV
public FLV()Default constructor, used by Spring so that parameters may be injected. -
FLV
Create FLV from given file source- Parameters:
file
- File source
-
FLV
Create FLV from given file source and with specified metadata generation option- Parameters:
file
- File sourcegenerateMetadata
- Metadata generation option
-
-
Method Details
-
setCache
Sets the cache implementation to be used. -
setWriterPostProcessor
Sets a writer post processor.- Parameters:
writerPostProcessor
- IPostProcess implementation class name
-
setWriterPostProcessors
Sets a group of writer post processors.- Parameters:
writerPostProcessors
- IPostProcess implementation class names
-
getWritePostProcessors
-
hasMetaData
public boolean hasMetaData()Returns a boolean stating whether the flv has metadata- Specified by:
hasMetaData
in interfaceIFLV
- Returns:
- boolean
true
if file has injected metadata,false
otherwise
-
getMetaData
Returns a map of the metadata- Specified by:
getMetaData
in interfaceIFLV
- Returns:
- metadata File metadata
- Throws:
FileNotFoundException
- File not found
-
hasKeyFrameData
public boolean hasKeyFrameData()Returns a boolean stating whether a flv has keyframedata- Specified by:
hasKeyFrameData
in interfaceIFLV
- Returns:
- boolean
true
if file has keyframe metadata,false
otherwise
-
setKeyFrameData
Sets the keyframe data of a flv file- Specified by:
setKeyFrameData
in interfaceIFLV
- Parameters:
keyframedata
- Keyframe metadata
-
getKeyFrameData
Gets the keyframe data- Specified by:
getKeyFrameData
in interfaceIFLV
- Returns:
- keyframedata Keyframe metadata
-
refreshHeaders
Refreshes the headers. Usually used after data is added to the flv file- Specified by:
refreshHeaders
in interfaceIFLV
- Throws:
IOException
- Any I/O exception
-
flushHeaders
Flushes Header- Specified by:
flushHeaders
in interfaceIFLV
- Throws:
IOException
- Any I/O exception
-
getReader
Returns a reader to parse and read the tags inside the file.- Specified by:
getReader
in interfaceIStreamableFile
- Returns:
- the reader Tag reader
- Throws:
IOException
- I/O exception
-
readerFromNearestKeyFrame
Returns a Reader closest to the nearest keyframe- Specified by:
readerFromNearestKeyFrame
in interfaceIFLV
- Parameters:
seekPoint
- Point in file we are seeking around- Returns:
- reader Tag reader closest to that point
-
getWriter
Returns a writer that creates a new file or truncates existing contents.- Specified by:
getWriter
in interfaceIStreamableFile
- Returns:
- the writer Tag writer
- Throws:
IOException
- I/O exception
-
getAppendWriter
Returns a Writer which is setup to append to the file.- Specified by:
getAppendWriter
in interfaceIStreamableFile
- Returns:
- the writer Tag writer used for append mode
- Throws:
IOException
- I/O exception
-
writerFromNearestKeyFrame
Returns a Writer based on the nearest key frame- Specified by:
writerFromNearestKeyFrame
in interfaceIFLV
- Parameters:
seekPoint
- Point in file we are seeking around- Returns:
- writer Tag writer closest to that point
-
setMetaData
Sets the metadata- Specified by:
setMetaData
in interfaceIFLV
- Parameters:
meta
- Metadata object- Throws:
FileNotFoundException
- File not foundIOException
- Any other I/O exception
-
setMetaService
Sets the MetaService through Spring- Specified by:
setMetaService
in interfaceIFLV
- Parameters:
service
- Metadata service
-