Class StreamMediaInput
- Namespace
- LibVLCSharp.Shared
- Assembly
- LibVLCSharp.dll
A MediaInput implementation that reads from a .NET stream
public class StreamMediaInput : MediaInput, IDisposable
- Inheritance
-
StreamMediaInput
- Implements
- Inherited Members
Constructors
StreamMediaInput(Stream)
Initializes a new instance of StreamMediaInput, which reads from the given .NET stream.
public StreamMediaInput(Stream stream)
Parameters
streamStreamThe stream to be read from.
Remarks
You are still responsible to dispose the stream you give as input.
Methods
Close()
LibVLC calls this method when it wants to close the media.
public override void Close()
Open(out ulong)
LibVLC calls this method when it wants to open the media
public override bool Open(out ulong size)
Parameters
sizeulongThis value must be filled with the length of the media (or ulong.MaxValue if unknown)
Returns
- bool
trueif the stream opened successfully
Read(nint, uint)
LibVLC calls this method when it wants to read the media
public override int Read(nint buf, uint len)
Parameters
Returns
- int
strictly positive number of bytes read, 0 on end-of-stream, or -1 on non-recoverable error
Seek(ulong)
LibVLC calls this method when it wants to seek to a specific position in the media
public override bool Seek(ulong offset)
Parameters
offsetulongThe offset, in bytes, since the beginning of the stream
Returns
- bool
trueif the seek succeeded, false otherwise