Class MediaStreamBase
Media stream base properties/methods.
Inheritance
Implements
Inherited Members
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class MediaStreamBase : Stream, IStream
Constructors
MediaStreamBase(StreamType)
Initializes a new instance of the MediaStreamBase class.
Declaration
public MediaStreamBase(StreamType type)
Parameters
Type | Name | Description |
---|---|---|
StreamType | type | The type. |
Properties
CachedLocalDirection
Gets Cached Local Direction for this Media Stream. Internal use.
Declaration
public StreamDirection CachedLocalDirection { get; }
Property Value
Type | Description |
---|---|
StreamDirection |
CanonicalName
Gets the canonical name.
Declaration
[Obsolete("Use LocalCanonicalName instead.")]
public string CanonicalName { get; }
Property Value
Type | Description |
---|---|
System.String |
ControlTransportInfo
Gets control transport info.
Declaration
public abstract TransportInfo ControlTransportInfo { get; }
Property Value
Type | Description |
---|---|
TransportInfo |
Direction
Gets the Media Direction of a stream as a StreamDirection enumerator. The following stream direction values are defined:
- SendReceive: A stream that can send and receive.
- SendOnly: A stream that can send.
- ReceiveOnly: A stream that can receive.
- Inactive: A stream that cannot send or receive.
- Unset: A stream direction has not been set.
Declaration
public override StreamDirection Direction { get; }
Property Value
Type | Description |
---|---|
StreamDirection | The Media Direction as a StreamDirection enumerator. |
Overrides
Info
Gets the media stream info.
Declaration
public MediaStreamInfo Info { get; }
Property Value
Type | Description |
---|---|
MediaStreamInfo |
InputContent
Gets or sets the input content descriptor.
Declaration
public string InputContent { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
InputMuted
Gets or sets whether the input track is muted.
Declaration
public abstract bool InputMuted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Label
Gets a label that identifies this class.
Declaration
public override string Label { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
LocalBandwidth
Gets or sets the local bandwidth, in kbps. This value is signalled in the local session description sent to the remote endpoint so it can limit its outbound media bitrate. Use MaxReceiveBitrate to control inbound media bitrate once the session has been negotiated.
Declaration
public int LocalBandwidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
LocalCanonicalName
Gets the local canonical end-point identifier (CNAME) used by RTCP.
The CNAME is a unique identifier for endpoints across an application instance and can be used for third-party monitoring.
Declaration
public string LocalCanonicalName { get; }
Property Value
Type | Description |
---|---|
System.String |
LocalDirection
Gets or sets current direction indicated by the local description.
Declaration
public override StreamDirection LocalDirection { get; set; }
Property Value
Type | Description |
---|---|
StreamDirection |
Overrides
LocalMuted
Gets or sets a value indicating whether the local stream is muted.
A muted stream does not show or play media, but the stream is not disabled and its data continues to flow through the processing pipeline.
Alias for Muted.
Declaration
public bool LocalMuted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
MaxReceiveBitrate
Gets or sets the maximum bitrate that the connection receives in Kbps.
This value must be less than or equal to LocalBandwidth.
Declaration
public virtual int MaxReceiveBitrate { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
MaxSendBitrate
Gets or sets the maximum bitrate that the upstream connection sends in Kbps. This value must be less than or equal to RemoteBandwidth.
Declaration
public virtual int MaxSendBitrate { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Muted
Gets or sets whether the stream is muted.
A muted stream does not show or play media, but the stream is not disabled and its data continues to flow through the processing pipeline.
Alias for InputMuted.
Declaration
public bool Muted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
OutputContent
Gets or sets the output content descriptor.
Declaration
public string OutputContent { get; protected set; }
Property Value
Type | Description |
---|---|
System.String |
OutputMuted
Gets or sets whether the output track is muted.
A muted stream does not show or play media, but the source is not disabled and its data continues to flow through the processing pipeline.
Declaration
public abstract bool OutputMuted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
PendingLocalDirection
Gets or sets the pending local direction.
Declaration
protected StreamDirection PendingLocalDirection { get; set; }
Property Value
Type | Description |
---|---|
StreamDirection |
PreferredCodecs
Gets or sets any preferred codecs, in order of preference.
Declaration
public string[] PreferredCodecs { get; set; }
Property Value
Type | Description |
---|---|
System.String[] |
RelatedMediaDescription
Gets or sets related SDP Media Description
Declaration
protected MediaDescription RelatedMediaDescription { get; set; }
Property Value
Type | Description |
---|---|
MediaDescription |
RemoteBandwidth
Gets or sets the remote bandwidth in Kbps.
This value is signalled in the remote session description received from the remote endpoint.
Use MaxSendBitrate to control outbound media bitrate once the session has been negotiated.
Declaration
public int RemoteBandwidth { get; protected set; }
Property Value
Type | Description |
---|---|
System.Int32 |
RemoteCanonicalName
Gets the remote canonical name.
Declaration
public string RemoteCanonicalName { get; }
Property Value
Type | Description |
---|---|
System.String |
RemoteDirection
Gets or sets current direction indicated by the remote description.
Declaration
public override StreamDirection RemoteDirection { get; }
Property Value
Type | Description |
---|---|
StreamDirection |
Overrides
RemoteEncoding
Gets or sets the remote encoding.
Declaration
public virtual EncodingInfo RemoteEncoding { get; set; }
Property Value
Type | Description |
---|---|
EncodingInfo |
RemoteMuted
Gets or sets a value indicating if remote is muted.
Declaration
public bool RemoteMuted { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RemoteRequestedDeactivation
Gets Boolean value set when the server is currently requesting a 0 bitrate. This is to highlight the difference between when a stream is deactivated locally or by a control mechanism on the server. Internal Use
Declaration
public bool RemoteRequestedDeactivation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
RenegotiationPending
Gets or sets whether there exist changes that are pending SDP renegotiation.
Declaration
protected bool RenegotiationPending { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SimulcastMode
Gets or sets the simulcast mode.
Declaration
public abstract SimulcastMode SimulcastMode { get; set; }
Property Value
Type | Description |
---|---|
SimulcastMode |
Methods
ChangeDirection(StreamDirection)
Records the pending direction of this stream. The LocalDirection of this stream will be updated when the connection renegotiation commences.
Declaration
public override Error ChangeDirection(StreamDirection newDirection)
Parameters
Type | Name | Description |
---|---|---|
StreamDirection | newDirection |
Returns
Type | Description |
---|---|
Error |
Overrides
ExtractCanonicalName(MediaDescription, Boolean)
Extracts Canonical Name from SDP and sets it to the appropreate Stream property.
Declaration
protected void ExtractCanonicalName(MediaDescription mediaDescription, bool isLocalDescription)
Parameters
Type | Name | Description |
---|---|---|
MediaDescription | mediaDescription | Media description to process. |
System.Boolean | isLocalDescription | Flag indicating if this description is local. |
GetCodecDisabled(String)
Gets whether a codec is disabled.
Declaration
public bool GetCodecDisabled(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The codec name. |
Returns
Type | Description |
---|---|
System.Boolean | Whether the codec is disabled. |
PopulateInfo(MediaStreamInfo)
Populates the media stream info.
Declaration
protected abstract void PopulateInfo(MediaStreamInfo info)
Parameters
Type | Name | Description |
---|---|---|
MediaStreamInfo | info |
RaiseBitrateRequest(BitrateRequest)
Raises a bitrate request to the local track.
Declaration
public virtual bool RaiseBitrateRequest(BitrateRequest bitrateRequest)
Parameters
Type | Name | Description |
---|---|---|
BitrateRequest | bitrateRequest | The bitrate request. |
Returns
Type | Description |
---|---|
System.Boolean |
RaiseLocalEncodingDisabled(EncodingInfo)
Raises the OnLocalEncodingDisabled event.
Declaration
protected void RaiseLocalEncodingDisabled(EncodingInfo encoding)
Parameters
Type | Name | Description |
---|---|---|
EncodingInfo | encoding | The encoding. |
RaiseLocalEncodingEnabled(EncodingInfo)
Raises the OnLocalEncodingEnabled event.
Declaration
protected void RaiseLocalEncodingEnabled(EncodingInfo encoding)
Parameters
Type | Name | Description |
---|---|---|
EncodingInfo | encoding | The encoding. |
SetCodecDisabled(String, Boolean)
Sets whether a codec is disabled.
Declaration
public void SetCodecDisabled(string name, bool disabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The codec name. |
System.Boolean | disabled | Whether to disable the codec. |
Events
OnLocalEncodingDisabled
Raised when a local encoding is disabled.
Declaration
public event Action1<EncodingInfo> OnLocalEncodingDisabled
Event Type
Type | Description |
---|---|
Action1<EncodingInfo> |
OnLocalEncodingEnabled
Raised when a local encoding is enabled.
Declaration
public event Action1<EncodingInfo> OnLocalEncodingEnabled
Event Type
Type | Description |
---|---|
Action1<EncodingInfo> |