Class MatroskaStreamingFile
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaStreamingFile
-
public class MatroskaStreamingFile extends java.lang.ObjectHandles processing an MKV/WEBM 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 Summary
Constructors Constructor Description MatroskaStreamingFile(SeekableInputStream inputStream)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetArtist()doublegetDuration()java.lang.StringgetIsrc()longgetTimecodeScale()java.lang.StringgetTitle()MatroskaFileTrack[]getTrackList()voidprovideFrames(MatroskaTrackConsumer consumer)Provide data chunks for the specified track consumervoidreadFile()Read the headers and tracks from the file.voidseekToTimecode(int trackId, long timecode)Perform a seek to a specified timecode
-
-
-
Constructor Detail
-
MatroskaStreamingFile
public MatroskaStreamingFile(SeekableInputStream inputStream)
- Parameters:
inputStream- The input stream for the file
-
-
Method Detail
-
getTimecodeScale
public long getTimecodeScale()
- Returns:
- Timescale for the durations used in this file
-
getTitle
public java.lang.String getTitle()
- Returns:
- The title for this file.
-
getArtist
public java.lang.String getArtist()
-
getIsrc
public java.lang.String getIsrc()
-
getDuration
public double getDuration()
- Returns:
- Total duration of the file
-
getTrackList
public MatroskaFileTrack[] getTrackList()
- Returns:
- Array of tracks in this file
-
readFile
public void readFile() throws java.io.IOExceptionRead the headers and tracks from the file.- Throws:
java.io.IOException- On read error.
-
seekToTimecode
public void seekToTimecode(int trackId, long timecode)Perform a seek to a specified timecode- Parameters:
trackId- ID of the reference tracktimecode- Timecode using the timescale of the file
-
provideFrames
public void provideFrames(MatroskaTrackConsumer consumer) throws java.lang.InterruptedException
Provide data chunks for the specified track consumer- Parameters:
consumer- Track data consumer- Throws:
java.lang.InterruptedException- When interrupted externally (or for seek/stop).
-
-