Class 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 Detail

      • MpegStandardFileTrackProvider

        public MpegStandardFileTrackProvider​(MpegReader reader)
        Parameters:
        reader - MP4-specific reader
    • Method Detail

      • initialise

        public boolean initialise​(MpegTrackConsumer consumer)
        Specified by:
        initialise in interface MpegFileTrackProvider
        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
        Description copied from interface: MpegFileTrackProvider
        Provide audio frames to the frame consumer until the end of the track or interruption.
        Specified by:
        provideFrames in interface MpegFileTrackProvider
        Throws:
        java.lang.InterruptedException - When interrupted externally (or for seek/stop).
      • seekToTimecode

        public void seekToTimecode​(long timecode)
        Description copied from interface: MpegFileTrackProvider
        Perform 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:
        seekToTimecode in interface MpegFileTrackProvider
        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 header
        trackId - 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