Add Starting the Connection to Architecture

Sean DuBois 2021-01-30 15:05:39 -08:00
parent d495dfca8a
commit 4b1e1257f4

@ -45,6 +45,25 @@ For each SSRC we explicitly request the stream [srtpSession.OpenReadStream](http
`pion/srtp` allows you to open a [WriteStreamSRTP](https://github.com/pion/webrtc/blob/master/srtp_writer_future.go#L53). These are opened on the SRTP/SRTCP session objects in the `DTLSTransport`.
### Starting the Connection
Pion is made up of a collection of transports. You have one [ICETransport](https://github.com/pion/webrtc/blob/master/icetransport.go), [DTLSTransport](https://github.com/pion/webrtc/blob/master/dtlstransport.go) and
[SCTPTransport](https://github.com/pion/webrtc/blob/master/sctptransport.go). You will then have multiple [RTPSender](https://github.com/pion/webrtc/blob/master/rtpsender.go) and [RTPReceiver](https://github.com/pion/webrtc/blob/master/rtpreceiver.go).
These transports are started by [startTransports](https://github.com/pion/webrtc/blob/master/peerconnection.go#L2023) We need to know the following minimum details from the remote to start the transports.
* DTLS Fingerprint
* ICE User-fragment and Password
* Does the remote support SCTP
* What SSRCes does the remote wish to send
* What codecs does the remote support
All SDP parsing is done in [sdp.go](https://github.com/pion/webrtc/blob/master/sdp.go) and these functions are called through out the PeerConnection.
### Generating Offer/Answer
When calling [CreateOffer](https://github.com/pion/webrtc/blob/master/peerconnection.go#L581) or [CreateAnswer](https://github.com/pion/webrtc/blob/master/peerconnection.go#L769) Pion will generate a SessionDescription
that generates the current representation of the PeerConnection. If SetRemoteDescription has been called it will use [generateMatchedSDP](https://github.com/pion/webrtc/blob/master/peerconnection.go#L2169) Pion will take the remote
PeerConnections state into account. If Pion is generating the first SessionDescription it will use [generateUnmatchedSDP](https://github.com/pion/webrtc/blob/master/peerconnection.go#L2097)
## FAQ