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 ([email protected]), Luke Hubbard, Codegent Ltd ([email protected]), Paul Gregoire ([email protected])
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static ICacheStoreprivate Fileprivate booleanprotected static org.slf4j.Loggerprivate IMetaData<?,?> private IMetaServiceprivate static LinkedList<Class<IPostProcessor>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidFlushes 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.booleanReturns a boolean stating whether a flv has keyframedatabooleanReturns a boolean stating whether the flv has metadatareaderFromNearestKeyFrame(int seekPoint) Returns a Reader closest to the nearest keyframevoidRefreshes the headers.voidsetCache(ICacheStore cache) Sets the cache implementation to be used.voidsetKeyFrameData(Map keyframedata) Sets the keyframe data of a flv filevoidsetMetaData(IMetaData meta) Sets the metadatavoidsetMetaService(IMetaService service) Sets the MetaService through SpringvoidsetWriterPostProcessor(String writerPostProcessor) Sets a writer post processor.voidsetWriterPostProcessors(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:
hasMetaDatain interfaceIFLV- Returns:
- boolean
trueif file has injected metadata,falseotherwise
-
getMetaData
Returns a map of the metadata- Specified by:
getMetaDatain 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:
hasKeyFrameDatain interfaceIFLV- Returns:
- boolean
trueif file has keyframe metadata,falseotherwise
-
setKeyFrameData
Sets the keyframe data of a flv file- Specified by:
setKeyFrameDatain interfaceIFLV- Parameters:
keyframedata- Keyframe metadata
-
getKeyFrameData
Gets the keyframe data- Specified by:
getKeyFrameDatain interfaceIFLV- Returns:
- keyframedata Keyframe metadata
-
refreshHeaders
Refreshes the headers. Usually used after data is added to the flv file- Specified by:
refreshHeadersin interfaceIFLV- Throws:
IOException- Any I/O exception
-
flushHeaders
Flushes Header- Specified by:
flushHeadersin interfaceIFLV- Throws:
IOException- Any I/O exception
-
getReader
Returns a reader to parse and read the tags inside the file.- Specified by:
getReaderin interfaceIStreamableFile- Returns:
- the reader Tag reader
- Throws:
IOException- I/O exception
-
readerFromNearestKeyFrame
Returns a Reader closest to the nearest keyframe- Specified by:
readerFromNearestKeyFramein 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:
getWriterin 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:
getAppendWriterin 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:
writerFromNearestKeyFramein interfaceIFLV- Parameters:
seekPoint- Point in file we are seeking around- Returns:
- writer Tag writer closest to that point
-
setMetaData
Sets the metadata- Specified by:
setMetaDatain interfaceIFLV- Parameters:
meta- Metadata object- Throws:
FileNotFoundException- File not foundIOException- Any other I/O exception
-
setMetaService
Sets the MetaService through Spring- Specified by:
setMetaServicein interfaceIFLV- Parameters:
service- Metadata service
-