Class Transceiver
Transceiver of a peer connection.
A transceiver is a media "pipe" connecting the local and remote peers, and used to transmit media data (audio or video) between the peers. The transceiver has a media flow direction indicating whether it is sending and/or receiving any media, or is inactive. When sending some media, the transceiver's local track is used as the source of that media. Conversely, when receiving some media, that media is delivered to the remote media track of the transceiver. As a convenience, the local track can be null if the local peer does not have anything to send. In that case some empty media is automatically sent instead (black frames for video, silence for audio) at very reduced rate. To completely stop sending, the media direction must be changed instead.
Transceivers are owned by the peer connection which creates them, and cannot be destroyed nor removed from the peer connection. They become invalid when the peer connection is closed, and should not be used after that.
Namespace: Microsoft.MixedReality.WebRTC
Assembly: Microsoft.MixedReality.WebRTC.dll
Syntax
public class Transceiver : object
Remarks
This object corresponds roughly to the same-named notion in the WebRTC 1.0 standard when using the Unified Plan SDP semantic.
For Plan B semantic, where RTP transceivers are not available, this wrapper tries to emulate the transceiver concept of the Unified Plan semantic, and is therefore providing an abstraction over the WebRTC concept of transceivers.
Fields
| Improve this Doc View Source_desiredDirection
Backing field for Desired
Declaration
protected Transceiver.Direction _desiredDirection
Field Value
Type | Description |
---|---|
Transceiver. |
See Also
Properties
| Improve this Doc View SourceDesiredDirection
Transceiver direction desired by the user.
Once changed by the user, this value is the next direction that will be negotiated when
calling Create
After the negotiation is completed, this is generally equal to Negotiated
Changing the value of this property triggers a Renegotiation
Declaration
public Transceiver.Direction DesiredDirection { get; set; }
Property Value
Type | Description |
---|---|
Transceiver. |
See Also
| Improve this Doc View SourceLocalAudioTrack
Local audio track attached to the transceiver, if Media
The property has two uses:
- as a convenience getter to retrieve Local
Track already cast to a LocalAudio type, orTrack null
if the transceiver media kind is Video. - to attach a new local audio track if the transceiver is an audio transceiver;
otherwise this throws a
.
Declaration
public LocalAudioTrack LocalAudioTrack { get; set; }
Property Value
Type | Description |
---|---|
Local |
LocalTrack
Local track attached to the transceiver, which is used to send data to the remote peer
if Negotiated
Declaration
public LocalMediaTrack LocalTrack { get; }
Property Value
Type | Description |
---|---|
Local |
See Also
| Improve this Doc View SourceLocalVideoTrack
Local video track attached to the transceiver, if Media
The property has two uses:
- as a convenience getter to retrieve Local
Track already cast to a LocalVideo type, orTrack null
if the transceiver media kind is Audio. - to attach a new local video track if the transceiver is a video transceiver;
otherwise this throws a
.
Declaration
public LocalVideoTrack LocalVideoTrack { get; set; }
Property Value
Type | Description |
---|---|
Local |
MediaKind
Type of media carried by the transceiver, and by extension type of media of its tracks.
Declaration
public MediaKind MediaKind { get; }
Property Value
Type | Description |
---|---|
Media |
MlineIndex
Index of the media line in the SDP protocol for this transceiver. If the transceiver is not yet associated with a media line, this index has a negative value (invalid). Transceivers are associated when an offer, local or remote, is applied to the local peer connection. Consequently, transceivers created as a result of applying a remote offer are created in an associated state, with a media line index already valid, while transceivers created locally by the peer connection have an invalid index until the next offer.
Declaration
public int MlineIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
For Plan B semantic (Plan
See Also
| Improve this Doc View SourceName
A name for the transceiver, used for logging and debugging only.
This can be set on construction if the transceiver is created by the local peer using
Add
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
String |
NegotiatedDirection
Last negotiated transceiver direction. This is constant when changing Desired
Declaration
public Transceiver.Direction? NegotiatedDirection { get; protected set; }
Property Value
Type | Description |
---|---|
Nullable<Transceiver. |
See Also
| Improve this Doc View SourcePeerConnection
Peer connection this transceiver is part of.
Declaration
public PeerConnection PeerConnection { get; }
Property Value
Type | Description |
---|---|
Peer |
See Also
| Improve this Doc View SourceRemoteAudioTrack
Remote audio track attached to the transceiver, if Medianull
otherwise.
Declaration
public RemoteAudioTrack RemoteAudioTrack { get; }
Property Value
Type | Description |
---|---|
Remote |
RemoteTrack
Remote track attached to the transceiver, which is used to receive data from the
remote peer if Negotiated
Declaration
public MediaTrack RemoteTrack { get; }
Property Value
Type | Description |
---|---|
Media |
See Also
| Improve this Doc View SourceRemoteVideoTrack
Remote video track attached to the transceiver, if Medianull
otherwise.
Declaration
public RemoteVideoTrack RemoteVideoTrack { get; }
Property Value
Type | Description |
---|---|
Remote |
StreamIDs
List of stream IDs associated with the transceiver.
Declaration
public string[] StreamIDs { get; }
Property Value
Type | Description |
---|---|
String[] |
Methods
| Improve this Doc View SourceDirectionFromSendRecv(Boolean, Boolean)
Compute a transceiver direction from some send/receive booleans.
Declaration
public static Transceiver.Direction DirectionFromSendRecv(bool hasSend, bool hasRecv)
Parameters
Type | Name | Description |
---|---|---|
Boolean | hasSend | Does the direction includes sending? |
Boolean | hasRecv | Does the direction includes receiving? |
Returns
Type | Description |
---|---|
Transceiver. |
The computed transceiver direction. |
HasRecv(Transceiver.Direction)
Check whether the given direction includes receiving.
Declaration
public static bool HasRecv(Transceiver.Direction dir)
Parameters
Type | Name | Description |
---|---|---|
Transceiver. |
dir | The direction to check. |
Returns
Type | Description |
---|---|
Boolean |
|
HasRecv(Nullable<Transceiver.Direction>)
Check whether the given direction includes receiving.
Declaration
public static bool HasRecv(Transceiver.Direction? dir)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Transceiver. |
dir | The direction to check. |
Returns
Type | Description |
---|---|
Boolean |
|
HasSend(Transceiver.Direction)
Check whether the given direction includes sending.
Declaration
public static bool HasSend(Transceiver.Direction dir)
Parameters
Type | Name | Description |
---|---|---|
Transceiver. |
dir | The direction to check. |
Returns
Type | Description |
---|---|
Boolean |
|
HasSend(Nullable<Transceiver.Direction>)
Check whether the given direction includes sending.
Declaration
public static bool HasSend(Transceiver.Direction? dir)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Transceiver. |
dir | The direction to check. |
Returns
Type | Description |
---|---|
Boolean |
|
Events
| Improve this Doc View SourceAssociated
Event raised when the transceiver is associated with a media line, which therefore makes
the Mline
Declaration
public event TransceiverAssociatedDelegate Associated
Event Type
Type | Description |
---|---|
Transceiver |
Remarks
The event is not raised if the transceiver is created in an associated state, that is if
the transceiver is already associated when Transceiver
See Also
| Improve this Doc View SourceDirectionChanged
Event raised when the Negotiated
Declaration
public event TransceiverDirectionChangedDelegate DirectionChanged
Event Type
Type | Description |
---|---|
Transceiver |