Class MediaInput
- Namespace
- LibVLCSharp.Shared
- Assembly
- LibVLCSharp.dll
An abstract class that lets libvlc read a media from callbacks.
Override this to provide your own reading mechanism, or you can use the StreamMediaInput class
public abstract class MediaInput : IDisposable
- Inheritance
-
MediaInput
- Implements
- Derived
- Inherited Members
Constructors
MediaInput()
The constructor
protected MediaInput()
Properties
CanSeek
A value indicating whether this Media input can be seeked in.
public bool CanSeek { get; protected set; }
Property Value
GcHandle
The GCHandle to be passed to callbacks as userData
public GCHandle GcHandle { get; }
Property Value
Methods
Close()
LibVLC calls this method when it wants to close the media.
public abstract void Close()
Dispose()
Disposes of this instance
public void Dispose()
Dispose(bool)
Override this to dispose things in your child class
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
Open(out ulong)
LibVLC calls this method when it wants to open the media
public abstract 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 abstract 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 abstract bool Seek(ulong offset)
Parameters
offsetulongThe offset, in bytes, since the beginning of the stream
Returns
- bool
trueif the seek succeeded, false otherwise