Class VelvetVideoLib.DemuxerImpl

java.lang.Object
com.zakgof.velvetvideo.impl.VelvetVideoLib.DemuxerImpl
All Implemented Interfaces:
IDemuxer, java.lang.AutoCloseable, java.lang.Iterable<IDecodedPacket<?>>
Enclosing class:
VelvetVideoLib

public class VelvetVideoLib.DemuxerImpl
extends java.lang.Object
implements IDemuxer
  • Constructor Details

  • Method Details

    • nextPacket

      public IDecodedPacket<?> nextPacket()
      Description copied from interface: IDemuxer
      Decodes and returns next packet in the container.
      Specified by:
      nextPacket in interface IDemuxer
      Returns:
      next packet or null if end of container reached
    • nextRawPacket

      public IRawPacket nextRawPacket()
      Description copied from interface: IDemuxer
      Obtains next media packet from the container without decoding it.
      Specified by:
      nextRawPacket in interface IDemuxer
      Returns:
      raw packet data of null if end of container reached
    • packetStream

      public java.util.stream.Stream<IDecodedPacket<?>> packetStream()
      Specified by:
      packetStream in interface IDemuxer
      Returns:
      stream of packets in the container
    • iterator

      public java.util.Iterator<IDecodedPacket<?>> iterator()
      Specified by:
      iterator in interface IDemuxer
      Specified by:
      iterator in interface java.lang.Iterable<IDecodedPacket<?>>
      Returns:
      iterator of packets in the container
    • videoStreams

      public java.util.List<? extends IVideoDecoderStream> videoStreams()
      Specified by:
      videoStreams in interface IDemuxer
      Returns:
      list of container's video streams
    • videoStream

      public IVideoDecoderStream videoStream​(int index)
      Specified by:
      videoStream in interface IDemuxer
      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.
    • audioStreams

      public java.util.List<? extends IAudioDecoderStream> audioStreams()
      Specified by:
      audioStreams in interface IDemuxer
      Returns:
      list of container's audio streams
    • audioStream

      public IAudioDecoderStream audioStream​(int index)
      Specified by:
      audioStream in interface IDemuxer
      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.
    • streams

      public java.util.List<IDecoderStream<?,​?,​?>> streams()
      Specified by:
      streams in interface IDemuxer
      Returns:
      list of container's media streams
    • metadata

      public java.util.Map<java.lang.String,​java.lang.String> metadata()
      Specified by:
      metadata in interface IDemuxer
      Returns:
      stream metadata as key to value map
    • properties

      public IContainerProperties properties()
      Specified by:
      properties in interface IDemuxer
      Returns:
      container properties
    • close

      public void close()
      Description copied from interface: IDemuxer
      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:
      close in interface java.lang.AutoCloseable
      Specified by:
      close in interface IDemuxer
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object