Class PublishingPoint
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
ConnectionInfo
Gets the publisher connection information.
public ConnectionInfo ConnectionInfo { get; }
Property Value
Created
Gets the date and time when this publishing point was created.
public DateTime Created { get; }
Property Value
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
PublishingPath
Gets the publishing path that uniquely identifies this publishing point on the server.
public string PublishingPath { get; }
Property Value
StreamingMode
Gets the streaming mode of this publishing point (live, VOD, or event).
public StreamingMode StreamingMode { get; }
Property Value
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
Title
Gets human readable description of the publishing point.
public string Title { get; }
Property Value
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
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
Methods
AddSink(IMediaSink, ApiSink)
Adds user created sink to publishing point
public void AddSink(IMediaSink sink, ApiSink additionalSinkParameters = null)
Parameters
sinkIMediaSinkUser created sink
additionalSinkParametersApiSinkOptional 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
shutdownReasonPublishingPoint.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
clientIdGuidThe 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
includeInternalboolIf
true, includes internal clients in the result; otherwise, excludes them.
Returns
- List<ConnectedClient>
A list of connected clients, or
nullif 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
includeInternalboolIf
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
durationTimeSpanBuffer duration
bufferingTypePublishingPoint.BufferingTypeBuffering type: memory or disk
StartForwarding(string)
Start re-streaming (forwarding) of this publishing point to another server.
public Guid StartForwarding(string uri)
Parameters
uristringURI to publish to
Returns
StartRecording(string)
Start recording of this publishing point
public Guid StartRecording(string path)
Parameters
pathstringFile path to record to
Returns
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
fileTypestringRecording file type, ex ".mp4", ".ts"
nextUriFunc<string>User defined function returning next file path to record to
rotationPeriodintRotation 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