Package com.zakgof.velvetvideo
Interface IDemuxer
- All Superinterfaces:
java.lang.AutoCloseable,java.lang.Iterable<IDecodedPacket<?>>
- All Known Implementing Classes:
VelvetVideoLib.DemuxerImpl
public interface IDemuxer extends java.lang.AutoCloseable, java.lang.Iterable<IDecodedPacket<?>>
Demuxer - media container reader.
-
Method Summary
Modifier and Type Method Description IAudioDecoderStreamaudioStream(int index)java.util.List<? extends IAudioDecoderStream>audioStreams()voidclose()Closes the demuxer, container file or other handles and frees all the allocated resources.java.util.Iterator<IDecodedPacket<?>>iterator()java.util.Map<java.lang.String,java.lang.String>metadata()IDecodedPacket<?>nextPacket()Decodes and returns next packet in the container.IRawPacketnextRawPacket()Obtains next media packet from the container without decoding it.java.util.stream.Stream<IDecodedPacket<?>>packetStream()IContainerPropertiesproperties()java.util.List<IDecoderStream<?,?,?>>streams()IVideoDecoderStreamvideoStream(int index)java.util.List<? extends IVideoDecoderStream>videoStreams()
-
Method Details
-
streams
java.util.List<IDecoderStream<?,?,?>> streams()- Returns:
- list of container's media streams
-
videoStreams
java.util.List<? extends IVideoDecoderStream> videoStreams()- Returns:
- list of container's video streams
-
audioStreams
java.util.List<? extends IAudioDecoderStream> audioStreams()- Returns:
- list of container's audio streams
-
videoStream
- Parameters:
index- of the stream in the container- Returns:
- container's video stream by index, or null if a stream with the specified index does not exist or is not video.
-
audioStream
- Parameters:
index- of the stream in the container- Returns:
- container's audio stream by index, or null if a stream with the specified index does not exist or is not audio.
-
metadata
java.util.Map<java.lang.String,java.lang.String> metadata()- Returns:
- stream metadata as key to value map
-
properties
IContainerProperties properties()- Returns:
- container properties
-
nextPacket
IDecodedPacket<?> nextPacket()Decodes and returns next packet in the container.- Returns:
- next packet or null if end of container reached
-
packetStream
java.util.stream.Stream<IDecodedPacket<?>> packetStream()- Returns:
- stream of packets in the container
-
iterator
java.util.Iterator<IDecodedPacket<?>> iterator()- Specified by:
iteratorin interfacejava.lang.Iterable<IDecodedPacket<?>>- Returns:
- iterator of packets in the container
-
nextRawPacket
IRawPacket nextRawPacket()Obtains next media packet from the container without decoding it.- Returns:
- raw packet data of null if end of container reached
-
close
void close()Closes the demuxer, container file or other handles and frees all the allocated resources. Calling this method is necessary after working with demuxer to avoid resource leaks.- Specified by:
closein interfacejava.lang.AutoCloseable
-