Class MatroskaContainerProbe
- java.lang.Object
-
- com.sedmelluq.discord.lavaplayer.container.matroska.MatroskaContainerProbe
-
- All Implemented Interfaces:
MediaContainerProbe
public class MatroskaContainerProbe extends java.lang.Object implements MediaContainerProbe
Container detection probe for matroska format.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAAC_CODECstatic java.lang.StringOPUS_CODECstatic java.lang.StringVORBIS_CODEC
-
Constructor Summary
Constructors Constructor Description MatroskaContainerProbe()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AudioTrackcreateTrack(java.lang.String parameters, AudioTrackInfo trackInfo, SeekableInputStream inputStream)Creates a new track for this container.java.lang.StringgetName()booleanmatchesHints(MediaContainerHints hints)MediaContainerDetectionResultprobe(AudioReference reference, SeekableInputStream inputStream)Detect whether the file readable from the input stream is using this container and if this specific file uses a format and codec that is supported for playback.
-
-
-
Field Detail
-
OPUS_CODEC
public static final java.lang.String OPUS_CODEC
- See Also:
- Constant Field Values
-
VORBIS_CODEC
public static final java.lang.String VORBIS_CODEC
- See Also:
- Constant Field Values
-
AAC_CODEC
public static final java.lang.String AAC_CODEC
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceMediaContainerProbe- Returns:
- The name of this container
-
matchesHints
public boolean matchesHints(MediaContainerHints hints)
- Specified by:
matchesHintsin interfaceMediaContainerProbe- Parameters:
hints- The available hints about the possible container.- Returns:
- True if the hints match the format this probe detects. Should always return false if all hints are null.
-
probe
public MediaContainerDetectionResult probe(AudioReference reference, SeekableInputStream inputStream) throws java.io.IOException
Description copied from interface:MediaContainerProbeDetect whether the file readable from the input stream is using this container and if this specific file uses a format and codec that is supported for playback.- Specified by:
probein interfaceMediaContainerProbe- Parameters:
reference- Reference with an identifier to use in the returned audio track infoinputStream- Input stream that contains the track file- Returns:
- Returns result with audio track on supported format, result with unsupported reason set if this is the container that the file uses, but this specific file uses a format or codec that is not supported. Returns null in case this file does not appear to be using this container format.
- Throws:
java.io.IOException- On read error.
-
createTrack
public AudioTrack createTrack(java.lang.String parameters, AudioTrackInfo trackInfo, SeekableInputStream inputStream)
Description copied from interface:MediaContainerProbeCreates a new track for this container. The audio tracks created here are never used directly, but the playback is delegated to them. As such, they do not have to support cloning or have a source manager.- Specified by:
createTrackin interfaceMediaContainerProbe- Parameters:
parameters- Parameters specific to the probe.trackInfo- Track meta informationinputStream- Input stream of the track file- Returns:
- A new audio track
-
-