Class FLV

  • All Implemented Interfaces:
    IFLV, IStreamableFile

    public class FLV
    extends Object
    implements IFLV
    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 Detail

      • log

        protected static org.slf4j.Logger log
    • Constructor Detail

      • FLV

        public FLV()
        Default constructor, used by Spring so that parameters may be injected.
      • FLV

        public FLV​(File file)
        Create FLV from given file source
        Parameters:
        file - File source
      • FLV

        public FLV​(File file,
                   boolean generateMetadata)
        Create FLV from given file source and with specified metadata generation option
        Parameters:
        file - File source
        generateMetadata - Metadata generation option
    • Method Detail

      • setCache

        public void setCache​(ICacheStore cache)
        Sets the cache implementation to be used.
        Specified by:
        setCache in interface IFLV
        Parameters:
        cache - Cache store
      • setWriterPostProcessor

        public void setWriterPostProcessor​(String writerPostProcessor)
        Sets a writer post processor.
        Parameters:
        writerPostProcessor - IPostProcess implementation class name
      • setWriterPostProcessors

        public void setWriterPostProcessors​(Set<String> writerPostProcessors)
        Sets a group of writer post processors.
        Parameters:
        writerPostProcessors - IPostProcess implementation class names
      • hasMetaData

        public boolean hasMetaData()
        Returns a boolean stating whether the flv has metadata
        Specified by:
        hasMetaData in interface IFLV
        Returns:
        boolean true if file has injected metadata, false otherwise
      • hasKeyFrameData

        public boolean hasKeyFrameData()
        Returns a boolean stating whether a flv has keyframedata
        Specified by:
        hasKeyFrameData in interface IFLV
        Returns:
        boolean true if file has keyframe metadata, false otherwise
      • setKeyFrameData

        public void setKeyFrameData​(Map keyframedata)
        Sets the keyframe data of a flv file
        Specified by:
        setKeyFrameData in interface IFLV
        Parameters:
        keyframedata - Keyframe metadata
      • getKeyFrameData

        public Map getKeyFrameData()
        Gets the keyframe data
        Specified by:
        getKeyFrameData in interface IFLV
        Returns:
        keyframedata Keyframe metadata
      • refreshHeaders

        public void refreshHeaders()
                            throws IOException
        Refreshes the headers. Usually used after data is added to the flv file
        Specified by:
        refreshHeaders in interface IFLV
        Throws:
        IOException - Any I/O exception
      • readerFromNearestKeyFrame

        public ITagReader readerFromNearestKeyFrame​(int seekPoint)
        Returns a Reader closest to the nearest keyframe
        Specified by:
        readerFromNearestKeyFrame in interface IFLV
        Parameters:
        seekPoint - Point in file we are seeking around
        Returns:
        reader Tag reader closest to that point
      • writerFromNearestKeyFrame

        public ITagWriter writerFromNearestKeyFrame​(int seekPoint)
        Returns a Writer based on the nearest key frame
        Specified by:
        writerFromNearestKeyFrame in interface IFLV
        Parameters:
        seekPoint - Point in file we are seeking around
        Returns:
        writer Tag writer closest to that point
      • setMetaService

        public void setMetaService​(IMetaService service)
        Sets the MetaService through Spring
        Specified by:
        setMetaService in interface IFLV
        Parameters:
        service - Metadata service