Class VideoBackend
Per-VideoInstance playback backend. Concrete subclasses wrap a specific decoding implementation (FFmpeg, Windows Media Foundation, Android MediaCodec, ...). Instances are produced by CreateBackend(VideoInstance) at media-initialization time.
public abstract class VideoBackend : IDisposable
- Inheritance
-
objectVideoBackend
- Implements
- Extension Methods
Constructors
VideoBackend(VideoInstance)
protected VideoBackend(VideoInstance instance)
Parameters
instanceVideoInstance
Properties
Instance
protected VideoInstance Instance { get; }
Property Value
UsesHardwareDecode
True when this backend currently decodes via hardware (e.g. D3D11VA, NVDEC). May only become accurate after Initialize(string, long, long) and possibly Play(), depending on when the backend negotiates the codec.
public virtual bool UsesHardwareDecode { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public virtual void Dispose()
Initialize(string, long, long)
Open url for playback. Return false on failure.
public abstract bool Initialize(string url, long startPosition, long length)
Parameters
Returns
Pause()
public virtual void Pause()
Play()
public abstract void Play()
ReleaseMedia()
Release the currently-open media. Counterpart to Initialize(string, long, long).
public virtual void ReleaseMedia()
Seek(TimeSpan)
public virtual void Seek(TimeSpan time)
Parameters
timeTimeSpan
SetAudioVolume(float)
public virtual void SetAudioVolume(float volume)
Parameters
volumefloat
SetPlaybackSpeed(float)
public virtual void SetPlaybackSpeed(float speed)
Parameters
speedfloat
Stop()
public abstract void Stop()
Update(TimeSpan)
Per-frame tick. May update CurrentTime via SetCurrentTime(TimeSpan), and may call back into Stop() or Seek(TimeSpan) on end-of-media / loop conditions.
public abstract void Update(TimeSpan elapsed)
Parameters
elapsedTimeSpan
UpdateLoopRange()
public virtual void UpdateLoopRange()
UpdatePlayRange()
public virtual void UpdatePlayRange()