Table of Contents

Class FileSource

Namespace
VAST.MediaFoundation
Assembly
VAST.Common.Ext.Win32.dll

Provides file reading functionality using Media Foundation source reader. Supports various container formats and codecs.

public class FileSource : IMediaSource, IReferenceable, IDisposable
Inheritance
FileSource
Implements
Inherited Members

Constructors

FileSource()

Create new instance of FileSink

public FileSource()

Properties

Capabilities

Gets the list of source capabilities

public List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

IsDisposed

Can be used to check whether object is already disposed and can't be used anymore

public bool IsDisposed { get; }

Property Value

bool

IsNetworkSource

Whether it's a network or local source.

public bool IsNetworkSource { get; }

Property Value

bool

Parameters

Gets or sets source parameters

public SourceParameters Parameters { get; set; }

Property Value

SourceParameters

RefCount

Gets current reference count of the object

public int RefCount { get; }

Property Value

int

State

Current source state

public MediaState State { get; }

Property Value

MediaState

StreamCount

Total stream count of the source

public int StreamCount { get; }

Property Value

int

UniqueId

Unique id

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

URI to be opened to pull data from

public string Uri { get; set; }

Property Value

string

Methods

AddRef()

Add reference

public void AddRef()

Dispose()

Disposes used resources

public void Dispose()

GetMediaType(int)

Gets media type of the stream

public MediaType GetMediaType(int streamIndex)

Parameters

streamIndex int

Stream index to get media type for

Returns

MediaType

Media type of requested stream

Open()

Open source using specified URI

public void Open()

Release()

Release reference. If reference count becomes 0 then Dispose() method is called. Calling object must not use current object after this call.

public void Release()

SetDesiredOutputType(int, MediaType)

Sets desired output media type of the specified stream. Desired media type could be an incomplete media type specifying only necessary parameters. Source should implement decoding or encoding internally to provide requested output type. It is not guaranteed though that an actual output type will match a desired type exactly. GetMediaType function should be used to obtain actual output media type.

public Task SetDesiredOutputType(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

Stream index to set desired output media type for

mediaType MediaType

Desired media type

Returns

Task

Start()

Start media pushing

public void Start()

Stop()

Stop media pushing and closes the source

public void Stop()

Events

Error

Error occurred

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

NewSample

New sample is ready

public event EventHandler<NewSampleEventArgs> NewSample

Event Type

EventHandler<NewSampleEventArgs>

NewStream

New stream has been created

public event EventHandler<NewStreamEventArgs> NewStream

Event Type

EventHandler<NewStreamEventArgs>

StateChanged

Source state changed

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>