Class MpegFragmentedFileTrackProvider
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.container.mpeg.reader.fragmented.MpegFragmentedFileTrackProvider
-
- All Implemented Interfaces:
MpegFileTrackProvider
public class MpegFragmentedFileTrackProvider extends java.lang.Object implements MpegFileTrackProvider
Track provider for fragmented MP4 file format.
-
-
Constructor Summary
Constructors Constructor Description MpegFragmentedFileTrackProvider(MpegReader reader, MpegSectionInfo root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDuration()booleaninitialise(MpegTrackConsumer consumer)voidparseMovieExtended(MpegSectionInfo mvex)Handle mvex section.voidparseSegmentIndex(MpegVersionedSectionInfo sbix)Handle segment index section.voidprovideFrames()Provide audio frames to the frame consumer until the end of the track or interruption.voidseekToTimecode(long timecode)Perform a seek to the given timecode (ms).
-
-
-
Constructor Detail
-
MpegFragmentedFileTrackProvider
public MpegFragmentedFileTrackProvider(MpegReader reader, MpegSectionInfo root)
- Parameters:
reader- MP4-specific readerroot- Root section info (synthetic section wrapping the entire file)
-
-
Method Detail
-
initialise
public boolean initialise(MpegTrackConsumer consumer)
- Specified by:
initialisein interfaceMpegFileTrackProvider- Parameters:
consumer- Track consumer which defines the track this will provide and the consumer for packets.- Returns:
- Returns true if it had enough information for initialisation.
-
provideFrames
public void provideFrames() throws java.lang.InterruptedException, java.io.IOExceptionDescription copied from interface:MpegFileTrackProviderProvide audio frames to the frame consumer until the end of the track or interruption.- Specified by:
provideFramesin interfaceMpegFileTrackProvider- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).java.io.IOException- When network exception is happened, currently only throw from MpegFragmentedFileTrackProvider.
-
seekToTimecode
public void seekToTimecode(long timecode)
Description copied from interface:MpegFileTrackProviderPerform a seek to the given timecode (ms). On the next call to provideFrames, the seekPerformed method of frame consumer is called with the position where it actually seeked to and the position where the seek was requested to as arguments.- Specified by:
seekToTimecodein interfaceMpegFileTrackProvider- Parameters:
timecode- The timecode to seek to in milliseconds
-
getDuration
public long getDuration()
- Specified by:
getDurationin interfaceMpegFileTrackProvider- Returns:
- Total duration of the file in milliseconds
-
parseMovieExtended
public void parseMovieExtended(MpegSectionInfo mvex) throws java.io.IOException
Handle mvex section.- Parameters:
mvex- Section header.- Throws:
java.io.IOException- On read error
-
parseSegmentIndex
public void parseSegmentIndex(MpegVersionedSectionInfo sbix) throws java.io.IOException
Handle segment index section.- Parameters:
sbix- Section header.- Throws:
java.io.IOException- On read error
-
-