pub enum TrackEndpoints {
Send(WebRtcTrackSink),
Recv(WebRtcTrackSource),
SendRecv(WebRtcTrackSink, WebRtcTrackSource),
Inactive,
}webrtc only.Expand description
The endpoints a track actually has, which is exactly what its
negotiated Direction allows — a SendOnly track carries no
WebRtcTrackSource because nothing will ever arrive on it, and a
RecvOnly one carries no WebRtcTrackSink because str0m has no
send capability for it.
The variant is the direction, so there is no separate field the two could disagree with. Pushing into a sink that does not exist, or waiting on a source that does not, is a compile error rather than something that silently does nothing.
Fixed for the life of the track: these are handed out once, when the
track attaches, and a remote peer that later renegotiates a different
direction is reported on the Bus instead (see
WebRtcHandle::next_track).
Variants§
Send(WebRtcTrackSink)
Direction::SendOnly — outbound only.
Recv(WebRtcTrackSource)
Direction::RecvOnly — inbound only.
SendRecv(WebRtcTrackSink, WebRtcTrackSource)
Direction::SendRecv — both, on the one track.
Inactive
Direction::Inactive — neither, for now. Still handed out: the
track exists and its mid is negotiated, so a caller matching
attachments against its own WebRtcHandle::add_track calls has
to see it.