Class RtmpPublisherSink
Provides a media sink for publishing media streams to an RTMP server. Supports automatic reconnection and bandwidth monitoring.
public class RtmpPublisherSink : INetworkSink, IMediaSink, IDisposable, INetworkEndPoint, INetworkStat
- Inheritance
-
RtmpPublisherSink
- Implements
- Inherited Members
Constructors
RtmpPublisherSink()
Create new instance of RtmpSink
public RtmpPublisherSink()
Properties
Accept
Whether sink is accepted or not
public bool Accept { get; set; }
Property Value
Capabilities
Gets the list of sink capabilities
public List<SinkCapability> Capabilities { get; }
Property Value
CurrentStat
Gets current network statistics
public NetworkStat CurrentStat { get; }
Property Value
EndPoint
Connected end point info
public IPProtoEndPoint EndPoint { get; }
Property Value
IsNetworkSink
whether it's a network or local sink. Necessary to apply longer timeouts in media session processing logic.
public bool IsNetworkSink { get; }
Property Value
Parameters
Gets or sets sink parameters
public SinkParameters Parameters { get; set; }
Property Value
PublishingPath
Publishing point name extracted from the sink URI or by any other means (depends on the protocol)
public string PublishingPath { get; set; }
Property Value
ReceivedUri
End point URI used when connected (depends on the protocol)
public string ReceivedUri { get; set; }
Property Value
SocketError
Socket error got on disconnection
public ExtendedSocketError SocketError { get; }
Property Value
State
Current sink state
public MediaState State { get; }
Property Value
UniqueId
Unique stream id
public Guid UniqueId { get; set; }
Property Value
Uri
URI to be opened. Exact URI syntax depends on the implementation.
public string Uri { get; set; }
Property Value
Methods
AddStream(int, MediaType)
Add media stream for pushing
public void AddStream(int streamIndex, MediaType mediaType)
Parameters
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
streamIndexintStream index
sampleVersatileBufferMedia sample
Start(bool)
Start media pushing
public void Start(bool delayedStart = false)
Parameters
delayedStartboolWhether media samples are expected immediately or after significant time interval. Not used in current sink
Stop()
Stop media pushing
public void Stop()
addStream(int, MediaType)
Adds a media stream for publishing to the RTMP server.
public void addStream(int streamIndex, MediaType mediaType)
Parameters
Events
Error
Error occurred
public event EventHandler<ErrorEventArgs> Error
Event Type
StateChanged
Sink state changed
public event EventHandler<MediaState> StateChanged