Class MpegStandardFileTrackProvider
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.container.mpeg.reader.standard.MpegStandardFileTrackProvider
-
- All Implemented Interfaces:
MpegFileTrackProvider
public class MpegStandardFileTrackProvider extends java.lang.Object implements MpegFileTrackProvider
Track provider for the standard (non-fragmented) MP4 file format.
-
-
Constructor Summary
Constructors Constructor Description MpegStandardFileTrackProvider(MpegReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachSampleTableParsers(MpegReader.Chain sampleTableChain, int trackId)Attaches standard format specific handlers to sample table section handle chain.longgetDuration()booleaninitialise(MpegTrackConsumer consumer)voidprovideFrames()Provide audio frames to the frame consumer until the end of the track or interruption.voidreadMediaHeaders(MpegVersionedSectionInfo mdhd, int trackId)Read the mdhd section for a track.voidseekToTimecode(long timecode)Perform a seek to the given timecode (ms).
-
-
-
Constructor Detail
-
MpegStandardFileTrackProvider
public MpegStandardFileTrackProvider(MpegReader reader)
- Parameters:
reader- MP4-specific reader
-
-
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.
-
getDuration
public long getDuration()
- Specified by:
getDurationin interfaceMpegFileTrackProvider- Returns:
- Total duration of the file in milliseconds
-
provideFrames
public void provideFrames() throws java.lang.InterruptedExceptionDescription 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).
-
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
-
readMediaHeaders
public void readMediaHeaders(MpegVersionedSectionInfo mdhd, int trackId) throws java.io.IOException
Read the mdhd section for a track.- Parameters:
mdhd- The section headertrackId- Track ID- Throws:
java.io.IOException- On read error.
-
attachSampleTableParsers
public void attachSampleTableParsers(MpegReader.Chain sampleTableChain, int trackId)
Attaches standard format specific handlers to sample table section handle chain.- Parameters:
sampleTableChain- Sample table child section handler chain.trackId- Track ID
-
-