Vixen
02b45cc4
csharp
public sealed class WebMVideoStreamDecoder

A WebM file, decoded as it plays.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The join between the two halves of this module: a MatroskaDemuxer that turns a file into packets, and whatever VideoCodecRegistry has that can turn those packets into pictures. Neither knows about the other, and this is the fifty lines that make them one thing a player can hold.

It never returns NeedMoreData. The interface allows it, for a codec that reorders; this loops internally until a frame comes out or the file ends, because the caller is a decode thread whose entire job is to wait for a frame and there is nothing else it could usefully do with the answer.

The container stays reachable. Container is public because a WebM's audio track is in the same file and has to be demuxed by the same reader — see MatroskaAudioStreamDecoder, which shares this demuxer rather than opening the file twice.

Fields and properties (7)

  • public MatroskaDemuxer Container

    The demuxer, so that the same file's audio track can be read from it.

  • public MatroskaTrack Track

    What the container said about the track being decoded.

  • public VideoFormat Format

    The size and layout it produces.

  • public Int2 DisplaySize
  • public TimeSpan Duration

    How long the whole video is, or Zero if the container does not say.

  • public TimeSpan Position

    Where the decoder has got to.

  • public bool CanSeek

    Whether Seek works.

Methods (6)

  • public WebMVideoStreamDecoder(string path)

    Opens a file.

  • public WebMVideoStreamDecoder(Stream stream, bool leaveOpen = false)

    Opens a stream.

  • public WebMVideoStreamDecoder(MatroskaDemuxer demuxer, bool ownsDemuxer)

    Decodes the video track of a demuxer somebody else owns.

  • public VideoDecodeStatus DecodeNext(VideoFrame destination)

    Decodes the next frame.

  • public void Seek(TimeSpan position)

    Moves to a position.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (9)

  • VideoGameVideoPlayback
  • AudioMasterClockTestsVixen.Video.Tests
  • MatroskaAudioTestsVixen.Video.Tests
  • OpusAudioTrackTestsVixen.Video.Codecs.Tests
  • VideoPlaybackVixen.Video
  • VideoPlayerTestsVixen.Video.Tests
  • VideoSystemTestsVixen.Video.Tests
  • VideoTextureTestsVixen.Video.Tests
  • WebMVideoStreamDecoderTestsVixen.Video.Tests