Table of Contents

Class AndroidFileSink

Namespace
VAST.Media
Assembly
VAST.Common.Ext.Android.dll

Android-specific implementation of IMediaSink that writes media samples to an MP4 file using the Android MediaMuxer API. Supports file rotation and delayed start.

public class AndroidFileSink : IMediaSink, IDisposable, IUriRotatable
Inheritance
AndroidFileSink
Implements
Inherited Members

Constructors

AndroidFileSink()

Create new instance of FileSink

public AndroidFileSink()

Properties

Capabilities

Gets the list of sink capabilities

public List<SinkCapability> Capabilities { get; }

Property Value

List<SinkCapability>

IsNetworkSink

Gets whether it's a network or local sink. Necessary to apply longer timeouts in media session processing logic. Always false for this class.

public bool IsNetworkSink { get; }

Property Value

bool

NextUri

Gets or sets the function which returns next URI to be opened. Either Uri or NextUri shall be specified. Necessary for sinks with dynamically generated URI or file chunking. Exact URI syntax depends on the implementation.

public Func<string> NextUri { get; set; }

Property Value

Func<string>

Parameters

Gets or sets sink parameters

public SinkParameters Parameters { get; set; }

Property Value

SinkParameters

RotationPeriod

Gets or sets the rotation period in seconds after which the NextUri function will be called and sink will be re-created with the newly provided uri. Value 0 means no rotation.

public int RotationPeriod { get; set; }

Property Value

int

State

Gets the current sink state.

public MediaState State { get; }

Property Value

MediaState

UniqueId

Gets or sets the unique identifier for this sink instance.

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

Gets or sets the URI (file path) to be opened. Either Uri or NextUri shall be specified. Exact URI syntax depends on the implementation.

public string Uri { get; set; }

Property Value

string

Methods

AddStream(int, MediaType)

Add media stream for pushing

public void AddStream(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

Stream index

mediaType MediaType

Stream media type

Dispose()

Disposes used resources

public void Dispose()

Open()

Open sink using specified URI

public void Open()

PushMedia(int, VersatileBuffer)

Push media sample

public void PushMedia(int streamIndex, VersatileBuffer sample)

Parameters

streamIndex int

Stream index

sample VersatileBuffer

Media sample

Start(bool)

Start media pushing

public void Start(bool delayedStart = false)

Parameters

delayedStart bool

False if media samples are expected immediately. True if first media sample is expected after significant time interval (e.g. tens of seconds)

Stop()

Stop media pushing

public void Stop()

Events

Error

Error occurred

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

StateChanged

Sink state changed

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>

UriRotated

Output URI has been rotated

public event EventHandler<UriRotatedEventArgs> UriRotated

Event Type

EventHandler<UriRotatedEventArgs>