Class MpegFileLoader


  • public class MpegFileLoader
    extends java.lang.Object
    Handles processing an MP4 file for the purpose of streaming one specific track from it. Only performs seeks when absolutely necessary, as the stream may be a network connection, in which case each seek may require a new connection.
    • Constructor Detail

      • MpegFileLoader

        public MpegFileLoader​(SeekableInputStream inputStream)
        Parameters:
        inputStream - Stream to read the file from
    • Method Detail

      • getTrackList

        public java.util.List<MpegTrackInfo> getTrackList()
        Returns:
        List of tracks found in the file
      • parseHeaders

        public void parseHeaders()
        Read the headers of the file to get the list of tracks and data required for seeking.
      • getTextMetadata

        public java.lang.String getTextMetadata​(java.lang.String name)
        Parameters:
        name - Name of the text metadata field.
        Returns:
        Value of the metadata field, or null if no value or not a string.
      • getLastEventMessage

        public byte[] getLastEventMessage()
        Returns:
        Payload from the last emsg message encountered.
      • loadReader

        public MpegFileTrackProvider loadReader​(MpegTrackConsumer consumer)
        Parameters:
        consumer - Track information consumer that the track provider passes the raw packets to.
        Returns:
        Track audio provider.