#### Description
[RFC 6386](https://www.rfc-editor.org/rfc/rfc6386#section-9.1) describes
the least significant bit of the first byte of the header as:
```
A 1-bit frame type (0 for key frames, 1 for interframes).
```
The change is functionally a no-op, but the naming implies the wrong
logic (you would assume `isKeyFrame == 1` means it is a key frame, but
the opposite is true).
#### Reference issue
Fixes #...
#### Description
Currently, Pion returns an empty `sdpMid` and a 0 `sdpMLineIndex`. This
PR ensures Pion returns the corresponding `sdpMid` and `sdpMLineIndex`
for ICE candidates for clients that expects it. Fixes trickle issues.
#### Changes
1. `ICECandidates`: New fields `SDPMid` and `SDPMLineIndex`.
2. `ICEGatherer`: `SetMediaStreamIdentification` and return the correct
`SDPMid` and `SDPMLineIndex`.
3. `extractICEDetails`: Return a struct instead of multiple values.
4. `extractICEDetails` refactored the media description selection to a
different function.
5. Added new tests.
#### Reference issue
Fixes https://github.com/pion/webrtc/issues/2690
Fixes https://github.com/pion/webrtc/issues/1833
Fixes an issue where calling dataChannel.Close on
'connecting' state channels didn't work as expected.
When handling the `OnOpen` event detect if the
user has requested close.
Fixes#2659
https://github.com/pion/webrtc/pull/2696 introduced removing
datachannels from the sctptransport for better garbage collection.
That PR introduced a race condition for data channels created before
connection establishment. When an out of band negotiated data channel,
created before peerconnection establishment is detached, there's a race
between the data channel being removed from `r.dataChannels` and it
being copied in to the existing data channel slice in the
acceptDataChannels goroutine.
This PR fixes this race by copying the slice before any datachannels
could be detached.
Update MediaEngine codec creation to take into account remote
and local rtcp-fb. Before we would incorrectly always take
the remote rtcp-fb and ignore local.
Resolves#2943Resolves#2944Resolves#1968
It wasn't clear (at least to me)
what "idiomatic API" it's referring to.
But, judging from the `data-channels-detach` example comments,
this is what it's made for.
f29ef99b22/examples/data-channels-detach/main.go (L4)
Close peerconnection on DTLS.CloseNotify
could break ice restart with dtls restart,
when the dtls finger-print changed, the
browser could teardown the old dtlstransport
and establish new one then pion could close
the peerconnection and restart failed. So
browser don't do this and spec also don't
say peerconnection should close when dtls
is closed.
The way currently DTLS fingerprints and ICE credentials
are picked is causing interop issues as described in #2621
Peers which don't use Bundle can use different fingerprints
and credentials in each media section. Even though is
not (yet) supported by Pion, receiving an SDP offer from
such a peer is valid.
Additionally if Bundle is being used the group attribute
determines which media section is the master bundle section,
which establishes the transport. Currently Pion always
just uses the first credentials/fingerprint it can find
in the SDP, which results in not spec compliant behavior.
This PR attempts to fix the above issues and make
Pion more spec compliant and interoperable.
Fixes#2621
Raise the default ReceiveMTU to 1500, as same
as the default MTU setting of WebRTC. This is because
some senders, i.e. FFmpeg, may packetize RTP with 1460
payload + 12 RTP header + etc.
Fixes#2927
The performance of the SampleBuilder is significantly worse when using
the SampleBuilder. It would be good to evaluate improving the
performance of the JitterBuffer. However for the time being we are just
going to revert.
Resolve#2778
In use cases like SFU, it is useful to get just the selected candidate
pair stats to have access to current RTT on the peer connection. The
standard has a way to do `GetSelectedCandidatePair` on `ICETransport`,
but does not have a way to get stats of that pair.
Although not in standard, adding a method to `ICETransport` to get
selected candidate pair along similar lines of above method.
Pion extracts them from ssrc-group line so this didn't failed
Pion<->Pion. Chrome/FireFox uses the dedicated a=ssrc lines and our
Offer/Answer would break negotation
Fixes#2922