Class MediaStream
Inheritance
System.Object
MediaStream
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: SIPSorcery.dll
Constructors
|
Improve this Doc
View Source
Declaration
public MediaStream(RtpSessionConfig config, int index)
Parameters
Fields
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
protected List<MediaStream.PendingPackages> _pendingPackagesBuffer
Field Value
|
Improve this Doc
View Source
Declaration
protected object _pendingPackagesLock
Field Value
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
Declaration
Field Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Declaration
protected RTPChannel rtpChannel
Field Value
|
Improve this Doc
View Source
SecureContext
Declaration
protected SecureContext SecureContext
Field Value
|
Improve this Doc
View Source
Declaration
protected SrtpHandler SrtpHandler
Field Value
Properties
|
Improve this Doc
View Source
Declaration
public bool AcceptRtpFromAny { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
The remote RTP control end point this stream is sending to RTCP reports for the media stream to.
Declaration
public IPEndPoint ControlDestinationEndPoint { get; set; }
Property Value
Type |
Description |
System.Net.IPEndPoint |
|
|
Improve this Doc
View Source
Default RTP event format that we support.
Declaration
public static SDPAudioVideoMediaFormat DefaultRTPEventFormat { get; }
Property Value
|
Improve this Doc
View Source
The remote RTP end point this stream is sending media to.
Declaration
public IPEndPoint DestinationEndPoint { get; set; }
Property Value
Type |
Description |
System.Net.IPEndPoint |
|
|
Improve this Doc
View Source
Indicates whether the session has been closed. Once a session is closed it cannot
be restarted.
Declaration
public bool IsClosed { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
The local track. Will be null if we are not sending this media.
Declaration
public MediaStreamTrack LocalTrack { get; set; }
Property Value
|
Improve this Doc
View Source
Declaration
public SDPMediaTypesEnum MediaType { get; set; }
Property Value
|
Improve this Doc
View Source
In order to detect RTP events from the remote party this property needs to
be set to the payload ID they are using.
Declaration
public int RemoteRtpEventPayloadID { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
The remote video track. Will be null if the remote party is not sending this media
Declaration
public MediaStreamTrack RemoteTrack { get; set; }
Property Value
|
Improve this Doc
View Source
The reporting session for this media stream.
Declaration
public RTCPSession RtcpSession { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
Declaration
public void AddBuffer(TimeSpan dropPacketTimeout)
Parameters
Type |
Name |
Description |
System.TimeSpan |
dropPacketTimeout |
|
|
Improve this Doc
View Source
Declaration
protected virtual bool AddPendingPackage(RTPHeader hdr, int localPort, IPEndPoint remoteEndPoint, byte[] buffer, VideoStream videoStream = null)
Parameters
Type |
Name |
Description |
RTPHeader |
hdr |
|
System.Int32 |
localPort |
|
System.Net.IPEndPoint |
remoteEndPoint |
|
System.Byte[] |
buffer |
|
VideoStream |
videoStream |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public void AddRtpChannel(RTPChannel rtpChannel)
Parameters
|
Improve this Doc
View Source
Adjusts the expected remote end point for a particular media type.
Declaration
protected bool AdjustRemoteEndPoint(uint ssrc, IPEndPoint receivedOnEndPoint)
Parameters
Type |
Name |
Description |
System.UInt32 |
ssrc |
The SSRC from the RTP packet header.
|
System.Net.IPEndPoint |
receivedOnEndPoint |
The actual remote end point that the RTP packet came from.
|
Returns
Type |
Description |
System.Boolean |
True if remote end point for this media type was the expected one or it was adjusted. False if
the remote end point was deemed to be invalid for this media type.
|
|
Improve this Doc
View Source
Declaration
protected bool CheckIfCanSendRtpRaw()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
protected virtual void ClearPendingPackages()
|
Improve this Doc
View Source
Creates a new RTCP session for a media track belonging to this RTP session.
Declaration
public bool CreateRtcpSession()
Returns
Type |
Description |
System.Boolean |
A new RTCPSession object. The RTCPSession must have its Start method called
in order to commence sending RTCP reports.
|
|
Improve this Doc
View Source
Declaration
protected virtual void DispatchPendingPackages()
|
Improve this Doc
View Source
Declaration
public bool EnsureBufferUnprotected(byte[] buf, RTPHeader header, out RTPPacket packet)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
public RTPReorderBuffer GetBuffer()
Returns
|
Improve this Doc
View Source
Declaration
public SrtpHandler GetOrCreateSrtpHandler()
Returns
|
Improve this Doc
View Source
Declaration
public RTPChannel GetRTPChannel()
Returns
|
Improve this Doc
View Source
GetSecurityContext()
Declaration
public SecureContext GetSecurityContext()
Returns
|
Improve this Doc
View Source
Attempts to get the highest priority sending format for the remote call party.
Declaration
public SDPAudioVideoMediaFormat GetSendingFormat()
Returns
|
Improve this Doc
View Source
Declaration
public bool HasRtpChannel()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsSecurityContextReady()
Declaration
public bool IsSecurityContextReady()
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Declaration
protected void LogIfWrongSeqNumber(string trackType, RTPHeader header, MediaStreamTrack track)
Parameters
|
Improve this Doc
View Source
Declaration
public void OnReceiveRTPPacket(RTPHeader hdr, int localPort, IPEndPoint remoteEndPoint, byte[] buffer, VideoStream videoStream = null)
Parameters
Type |
Name |
Description |
RTPHeader |
hdr |
|
System.Int32 |
localPort |
|
System.Net.IPEndPoint |
remoteEndPoint |
|
System.Byte[] |
buffer |
|
VideoStream |
videoStream |
|
|
Improve this Doc
View Source
Declaration
public void ProcessHeaderExtensions(RTPHeader header, IPEndPoint remoteEndPoint)
Parameters
Type |
Name |
Description |
RTPHeader |
header |
|
System.Net.IPEndPoint |
remoteEndPoint |
|
|
Improve this Doc
View Source
Declaration
public void RaiseOnReceiveReportByIndex(IPEndPoint ipEndPoint, RTCPCompoundPacket rtcpPCompoundPacket)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
ipEndPoint |
|
RTCPCompoundPacket |
rtcpPCompoundPacket |
|
|
Improve this Doc
View Source
Declaration
protected void RaiseOnRtpEventByIndex(IPEndPoint ipEndPoint, RTPEvent rtpEvent, RTPHeader rtpHeader)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
ipEndPoint |
|
RTPEvent |
rtpEvent |
|
RTPHeader |
rtpHeader |
|
|
Improve this Doc
View Source
Declaration
protected void RaiseOnRtpPacketReceivedByIndex(IPEndPoint ipEndPoint, RTPPacket rtpPacket)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
ipEndPoint |
|
RTPPacket |
rtpPacket |
|
|
Improve this Doc
View Source
Declaration
public void RemoveBuffer(TimeSpan dropPacketTimeout)
Parameters
Type |
Name |
Description |
System.TimeSpan |
dropPacketTimeout |
|
|
Improve this Doc
View Source
Allows sending of RTCP feedback reports.
Declaration
public void SendRtcpFeedback(RTCPFeedback feedback)
Parameters
Type |
Name |
Description |
RTCPFeedback |
feedback |
The feedback report to send.
|
|
Improve this Doc
View Source
Allows additional control for sending raw RTCP payloads
Declaration
public void SendRtcpRaw(byte[] rtcpBytes)
Parameters
Type |
Name |
Description |
System.Byte[] |
rtcpBytes |
Raw RTCP report data to send.
|
|
Improve this Doc
View Source
Sends the RTCP report to the remote call party.
Declaration
public void SendRtcpReport(RTCPCompoundPacket report)
Parameters
|
Improve this Doc
View Source
Allows additional control for sending raw RTP payloads. No framing or other processing is carried out.
Declaration
public void SendRtpRaw(byte[] data, uint timestamp, int markerBit, int payloadType)
Parameters
Type |
Name |
Description |
System.Byte[] |
data |
The RTP packet payload.
|
System.UInt32 |
timestamp |
The timestamp to set on the RTP header.
|
System.Int32 |
markerBit |
The value to set on the RTP header marker bit, should be 0 or 1.
|
System.Int32 |
payloadType |
The payload ID to set in the RTP header.
|
|
Improve this Doc
View Source
Declaration
protected void SendRtpRaw(byte[] data, uint timestamp, int markerBit, int payloadType, bool checkDone, ushort? seqNum = null)
Parameters
Type |
Name |
Description |
System.Byte[] |
data |
|
System.UInt32 |
timestamp |
|
System.Int32 |
markerBit |
|
System.Int32 |
payloadType |
|
System.Boolean |
checkDone |
|
System.Nullable<System.UInt16> |
seqNum |
|
|
Improve this Doc
View Source
Allows additional control for sending raw RTP payloads. No framing or other processing is carried out.
Declaration
public void SendRtpRaw(byte[] data, uint timestamp, int markerBit, int payloadType, ushort seqNum)
Parameters
Type |
Name |
Description |
System.Byte[] |
data |
The RTP packet payload.
|
System.UInt32 |
timestamp |
The timestamp to set on the RTP header.
|
System.Int32 |
markerBit |
The value to set on the RTP header marker bit, should be 0 or 1.
|
System.Int32 |
payloadType |
The payload ID to set in the RTP header.
|
System.UInt16 |
seqNum |
The RTP sequence number
|
|
Improve this Doc
View Source
Sets the remote end points for a media type supported by this RTP session.
Declaration
public void SetDestination(IPEndPoint rtpEndPoint, IPEndPoint rtcpEndPoint)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
rtpEndPoint |
The remote end point for RTP packets corresponding to the media type.
|
System.Net.IPEndPoint |
rtcpEndPoint |
The remote end point for RTCP packets corresponding to the media type.
|
|
Improve this Doc
View Source
To set a new value to a RTP Header extension.
According the extension the Object expected as value is different - check on each extension
Declaration
public void SetRtpHeaderExtensionValue(string uri, object value)
Parameters
Type |
Name |
Description |
System.String |
uri |
The URI of the extension to use
|
System.Object |
value |
Object to set on the extension (check extension to know object type)
|
|
Improve this Doc
View Source
SetSecurityContext(ProtectRtpPacket, ProtectRtpPacket, ProtectRtpPacket, ProtectRtpPacket)
Declaration
public void SetSecurityContext(ProtectRtpPacket protectRtp, ProtectRtpPacket unprotectRtp, ProtectRtpPacket protectRtcp, ProtectRtpPacket unprotectRtcp)
Parameters
|
Improve this Doc
View Source
Declaration
Returns
Type |
Description |
System.Boolean |
|
Events
|
Improve this Doc
View Source
Declaration
public event Action<bool> OnIsClosedStateChanged
Event Type
Type |
Description |
System.Action<System.Boolean> |
|
|
Improve this Doc
View Source
Gets fired when an RTCP report is received. This event is for diagnostics only.
Declaration
public event Action<int, IPEndPoint, SDPMediaTypesEnum, RTCPCompoundPacket> OnReceiveReportByIndex
Event Type
|
Improve this Doc
View Source
Gets fired when an RTP event is detected on the remote call party's RTP stream.
Declaration
public event Action<int, IPEndPoint, RTPEvent, RTPHeader> OnRtpEventByIndex
Event Type
Type |
Description |
System.Action<System.Int32, System.Net.IPEndPoint, RTPEvent, RTPHeader> |
|
|
Improve this Doc
View Source
Gets fired when an RTP Header packet is received from a remote party.
Parameters are:
- index of the AudioStream or VideoStream
- Remote endpoint packet was received from,
- The media type the packet contains, will be audio or video,
- The RTP Header exension URI.
Declaration
public event Action<int, IPEndPoint, SDPMediaTypesEnum, string, object> OnRtpHeaderReceivedByIndex
Event Type
Type |
Description |
System.Action<System.Int32, System.Net.IPEndPoint, SDPMediaTypesEnum, System.String, System.Object> |
|
|
Improve this Doc
View Source
Gets fired when an RTP packet is received from a remote party.
Parameters are:
- index of the AudioStream or VideoStream
- Remote endpoint packet was received from,
- The media type the packet contains, will be audio or video,
- The full RTP packet.
Declaration
public event Action<int, IPEndPoint, SDPMediaTypesEnum, RTPPacket> OnRtpPacketReceivedByIndex
Event Type
|
Improve this Doc
View Source
Gets fired when an RTCP report is sent. This event is for diagnostics only.
Declaration
public event Action<int, SDPMediaTypesEnum, RTCPCompoundPacket> OnSendReportByIndex
Event Type
|
Improve this Doc
View Source
Fires when the connection for a media type is classified as timed out due to not
receiving any RTP or RTCP packets within the given period.
Declaration
public event Action<int, SDPMediaTypesEnum> OnTimeoutByIndex
Event Type
Extension Methods