Commit Graph

67 Commits

Author SHA1 Message Date
Sean DuBois
3a60d8dae8 Support ICE values at session level
Also add tests to assert we don't have conflicting values. This could
have happened before but we never tested for it.
2020-06-10 00:17:06 -07:00
Sean DuBois
f78334d9d4 Only start SCTP if RemoteDescription requests
Relates to #346
2020-05-18 00:05:40 -07:00
Simone Gotti
9cd89ddc00 Start the right receiver
From PR #1158 during negotiation every required transceiver is assigned
to a specific media section (using the media section mid value).

The same should be done when starting receivers. We should start the
receiver assigned to the media section of that track.
2020-05-06 19:37:45 +02:00
Sean DuBois
32070dc053 Remove TODO for #753
I have resolved this issue, we don't need to support both ECDSA/RSA at
the same time. Most users will only ever do ECDSA anyway.
2020-04-26 01:03:16 -07:00
Jerko Steiner
eb2cdd6be0 Filter out non-sending incoming tracks
This modification will only keep incoming tracks from media sections
with `a=sendrecv` or `a=sendonly` attributes. This modification is not
necessary for pion-to-pion peer connections, but for browser-to-pion
connections using Unified Plan.

Background:

When a `RTCPeerConnection#removeTrack()` is called in the browser and
the connection is renegotiated, the browser (tested in Firefox 75.0)
will change the media section attribute to `a=recvonly` from
`a=sendrecv`, or `a=inactive` from `a=sendonly`, but will keep the same
`a=ssrc:<ssrc>` associated with the same media (mid) section.

Previously, when a remote track obtained with Pion's `OnTrack()` handler
was being read from, and this remote track was later removed in the
browser, the track's `Read()` method would never return `io.EOF` (unless
the peer connection was closed).

With this commit, the `trackDetailsFromSDP` function will only include
remote track details whose media section has `a=sendonly` or
`a=sendrecv` attributes, and previously existing logic will ensure that
a receiver for that specific ssrc is stopped, so that
`webrtc.Track#Read()` method returns `io.EOF`.
2020-04-21 01:25:32 -07:00
Sean DuBois
efb33be1f4 Simplify populateLocalCandidates
populateLocalCandidates was created when refactoring, logic that should
have existed in the caller was pushed into it.

Relates to #1143
2020-04-18 16:16:46 -07:00
Jerko Steiner
035b2d5fbe Update comment for AttrKeyMsid
Remove TODO and add explanation how this maps to MediaStream.id in the
browser.
2020-04-14 08:42:00 +02:00
Jerko Steiner
16373a520d Use switch/case over if/else for media attrs
Also updated sdp to v2.3.6 so sd.AttrKeyMsid can be used.
2020-04-14 08:42:00 +02:00
Jerko Steiner
eafd869204 Re-set track.id and track.label before OnTrack
See https://github.com/pion/webrtc/issues/1134
2020-04-14 08:42:00 +02:00
Jerko Steiner
729613095d Read "a=msid:<track_id> <track_label>"
This format is used in SDP answers by Unified plan in Firefox and
Chrome.
2020-04-14 08:42:00 +02:00
Sean DuBois
b1bb363bc0 Fix candidate population in SDP
* Don't add end-of-candidates until gathering complete
* Don't double add candidates

Resolves #1121
2020-04-04 22:51:39 -07:00
Simon Eisenmann
d41ef0b6b4 Ignore rtx ssrc FID group when extracting tracks
If the remote description contains rtx information via a `ssrc-group`,
the extra `ssrc` entries must be ignored to ensure thats no receiver
is added for them.

This can solve issues like `Incoming unhandled RTP ssrc(1858531374)` if
those are caused by a wrong receiver getting started for the rtx ssrc
but not for the track ssrc, based on the ssrc/transceiver oder in the
remote description.

Until rtx is properly supported, this change fixes the imediate issue
that some remote streams are randomly not received because of a remotes
rtx information.

Fixes: #1081
Related: #1083
2020-03-22 00:48:30 -07:00
Sean DuBois
00ba9ab52e Split ICE and DTLS related SDP parsing out
Move this stuff out of SetRemoteDescription so it will be easier to test

Relates to #1023
2020-02-14 18:53:19 -08:00
Sean DuBois
0652581dd1 Add test for multi-track PlanB signaling
SDP parsing only supported one ssrc per media section.
Now we properly can handle multiple.

Resolves #1014
2020-02-11 13:15:41 -08:00
Sean DuBois
0b8bdebeeb Make RTPTransceiver thread safe
Sender, Receiver and Direction are now atomics with functions
for getters and setters

Relates to #207
2020-02-09 21:40:37 -08:00
Sean DuBois
53014d3eb8 Move SDP code into dedicated file
Remove some duplication that makes re-negotiation harder.
By splitting parsing of inbound SDP and creation of outbound
it makes the next step a lot easier.

Relates to #207
2020-02-09 21:40:37 -08:00
Sean DuBois
f1ffb81649 Remove code duplication in track/transceiver code
Have AddTrack call transceiver code. Also update AddTransceiverFromKind
to call AddTransceiverFromTrack

Relates to #207
2020-02-09 21:40:37 -08:00