Table of Contents

Class PublishingPoint

Namespace
VAST.Network
Assembly
VAST.Network.dll

Represents a single publishing point on the streaming server that manages a media source and its associated client sinks. A publishing point routes media data from a source to one or more connected clients.

public sealed class PublishingPoint : IDisposable
Inheritance
PublishingPoint
Implements
Inherited Members

Properties

ActualShutdownReason

Gets the actual reason this publishing point was shut down.

public PublishingPoint.ShutdownReason ActualShutdownReason { get; }

Property Value

PublishingPoint.ShutdownReason

ConnectionInfo

Gets the publisher connection information.

public ConnectionInfo ConnectionInfo { get; }

Property Value

ConnectionInfo

Created

Gets the date and time when this publishing point was created.

public DateTime Created { get; }

Property Value

DateTime

Descriptor

Gets the API descriptor for this publishing point, including source, sinks, and processing information. Can return null if the publishing point is being disposed.

public ApiPublishingPointRequest Descriptor { get; }

Property Value

ApiPublishingPointRequest

PublishingPath

Gets the publishing path that uniquely identifies this publishing point on the server.

public string PublishingPath { get; }

Property Value

string

StreamingMode

Gets the streaming mode of this publishing point (live, VOD, or event).

public StreamingMode StreamingMode { get; }

Property Value

StreamingMode

Streams

Gets the list of streams of current publishing points. Can return null if stream descriptor is not ready yet or source has been disconnected.

public List<MediaType> Streams { get; }

Property Value

List<MediaType>

Title

Gets human readable description of the publishing point.

public string Title { get; }

Property Value

string

UniqueId

Gets the unique identifier of the publishing point. For live publishing points it is equal to the source unique identifier. VOD publishing points have their own unique identifier.

public Guid UniqueId { get; }

Property Value

Guid

UserData

Gets or sets user data. Can be used to attach user specific data to a publishing point.

public object UserData { get; set; }

Property Value

object

Methods

AddSink(IMediaSink, ApiSink)

Adds user created sink to publishing point

public void AddSink(IMediaSink sink, ApiSink additionalSinkParameters = null)

Parameters

sink IMediaSink

User created sink

additionalSinkParameters ApiSink

Optional sink parameters

Disconnect(ShutdownReason)

Forcibly disconnects current publisher session as well as all client sessions receiving this published stream. If recording was initialized then it is stopped as well.

public void Disconnect(PublishingPoint.ShutdownReason shutdownReason = ShutdownReason.UserInitiated)

Parameters

shutdownReason PublishingPoint.ShutdownReason

Dispose()

Releases all resources used by the PublishingPoint, including stopping and disposing all connected sinks, releasing the source, and cleaning up buffered data.

public void Dispose()

GetClient(Guid)

Gets a connected client by its unique identifier.

public ConnectedClient GetClient(Guid clientId)

Parameters

clientId Guid

The unique identifier of the client.

Returns

ConnectedClient

The connected client if found; otherwise, null.

GetClients(bool)

Gets a list of all connected clients for this publishing point.

public List<ConnectedClient> GetClients(bool includeInternal = false)

Parameters

includeInternal bool

If true, includes internal clients in the result; otherwise, excludes them.

Returns

List<ConnectedClient>

A list of connected clients, or null if the publishing point is being disposed.

GetClientsCount(bool)

Gets the number of connected clients for this publishing point.

public int GetClientsCount(bool includeInternal = false)

Parameters

includeInternal bool

If true, includes internal clients in the count; otherwise, excludes them.

Returns

int

The number of connected clients.

Resume()

Resumes suspended publishing point and starts pushing samples to sinks

public void Resume()

SetBuffering(TimeSpan, BufferingType)

Sets buffering of media data according to specified parameters. Buffering can be used to introduce delay to a live source stream or to make receiving of live source samples smoother.

public void SetBuffering(TimeSpan duration, PublishingPoint.BufferingType bufferingType)

Parameters

duration TimeSpan

Buffer duration

bufferingType PublishingPoint.BufferingType

Buffering type: memory or disk

StartForwarding(string)

Start re-streaming (forwarding) of this publishing point to another server.

public Guid StartForwarding(string uri)

Parameters

uri string

URI to publish to

Returns

Guid

StartRecording(string)

Start recording of this publishing point

public Guid StartRecording(string path)

Parameters

path string

File path to record to

Returns

Guid

StartRecording(string, Func<string>, int)

Start recording of this publishing point using specified file name and recording parameters

public Guid StartRecording(string fileType, Func<string> nextUri, int rotationPeriod)

Parameters

fileType string

Recording file type, ex ".mp4", ".ts"

nextUri Func<string>

User defined function returning next file path to record to

rotationPeriod int

Rotation period in seconds after which the NextUri function will be called and sink will be re-created with the newly provided uri.

Returns

Guid

Unique id of the recording sink