Commit Graph

66 Commits

Author SHA1 Message Date
Sean DuBois
a67c66a0c5 Upgrade pion/rtp to v2
Also updates interceptor and srtp
2021-07-29 11:18:41 -04:00
Juliusz Chroboczek
ee255e8956 Avoid crash after a PC callback has been reset
We used to crash if a PC callback was reset, due to confusion
between a nil interface and an interface whose value is nil.

Fixes #1871
2021-07-07 10:28:26 -04:00
digitalix
7948437b0b Fixed deadlock in peerconnection.go
In some rare cases during ice connection stage
change may result in deadlock. This fix makes
iceConnectionState and connectionState atomic
which should prevent deadlock.
2021-06-20 14:50:43 -04:00
Markus Tzoe
fb4b5826ae Fixes SDP session id
SDP session id should stay unchanged for subsequent offers/answers
2021-04-15 06:19:26 +08:00
Markus Tzoe
a0b3117680 RtpTransceiverInit => RTPTransceiverInit
since RtpTransceiverInit is deprecated
2021-04-15 06:19:26 +08:00
aler9
ae0f74edff Set answer as sendonly in case of a recvonly offer
When a local peer connection has a single transceiver with a sendrecv
direction, and the remote has a transceiver with a recvonly direction,
the local peer connection must change the transceiver direction to
sendonly.

When a local peer connection has a single transceiver with a recvonly
direction, and the remote has a transceiver with a recvonly direction,
the local peer connection must create another transceiver with a
sendonly direction.

A unit test is added to cover all possible cases.
2021-02-22 15:23:27 -08:00
donotanswer
8e8567040c Update ice-lite remote check to ignore whitespace
When parsing SDP, ice-lite attributes with whitespaces
were parsed incorrectly. This fix trims whitespaces.
2021-02-19 09:10:28 -08:00
Sean DuBois
9c7b365144 Use closePairNow in tests
Instead of explicitly closing each PeerConnection use helper.
No change in test behavior, just makes code more consistent.
2021-02-16 15:47:58 -08:00
Sean DuBois
ff1bc32221 Don't leak ICETransport routines
We didn't properly pass a context to the ICE Agent. We would leak
routines if closed while connecting.
2020-12-13 17:18:04 -08:00
ZHENK
3eb51d8a09 Pass nil candidate into pion/ice
Pass empty string candidate.Candidate into pion/ice to handle.

Co-authored-by: JooYoung <qkdlql@naver.com>

Resolves #1212
2020-12-09 16:17:17 -08:00
Sean DuBois
9715626a0c Revert "Read/Write RTP/RTCP packets with context"
This change caused a ~24% performance decrease

Relates to pion/webrtc#1564

This reverts commit 47a7a64898.
2020-12-02 20:11:06 -08:00
Atsushi Watanabe
47a7a64898 Read/Write RTP/RTCP packets with context
Control cancel/timeout by context.
2020-12-01 11:08:48 +09:00
Sean DuBois
661f5b83dd Use Trickle ICE for TestICERestart
Test both paths
2020-11-16 22:48:44 -08:00
Sean DuBois
4a80d10fd8 Simplify TestNegotiationNeededStressOneSided
Test still asserts that `OnNegotiationNeeded` is able to signal all
500 tracks.
2020-11-16 19:06:25 -08:00
Sean DuBois
7edfb701e0 New Track API
The Pion WebRTC API has been dramatically redesigned. The design docs
are located here [0]

You can also read the release notes [1] on how to migrate your
application.

[0] https://github.com/pion/webrtc-v3-design
[1] https://github.com/pion/webrtc/wiki/Release-WebRTC@v3.0.0
2020-11-15 09:20:47 -08:00
Sean DuBois
79d93e9835 Add TestICERestart_Error_Handling
Add test that asserts that a DataChannel message that is sent while
disconnected will be delivered after reconnected.

Relates to #1518
2020-11-13 05:21:37 -08:00
Sean DuBois
43f3b47307 Revert TestICERestart_Error_Handling
We need to fix pion/ice#252 first
2020-11-12 23:51:49 -08:00
Sean DuBois
50e4975877 Add TestICERestart_Error_Handling
Add test that asserts that a DataChannel message that is sent while
disconnected will be delivered after reconnected.

Relates to #1518
2020-11-12 22:51:30 -08:00
Sean DuBois
89c51a156c Rename SettingEngine mDNS Config option
GenerateMulticastDNSCandidates -> SetICEMulticastDNSMode.
Before a user wasn't able to disable mDNS. By changing it we can
do more with this API.
2020-10-05 16:52:21 -07:00
Sean DuBois
804a12fed3 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-30 09:06:34 -07:00
mission-liao
062e55d769 Avoid acquiring two reader privilege of a lock
It's an anti-pattern when using sync.RWMutex in golang.
After acquiring two reader privilege of a rwlock, it will deadlock if
another routine tries to acquire a writer lock.

In pion/webrtc, this calling sequence might happen when calling
GetTransceivers during track events.

Resolves #1425
2020-09-19 13:26:03 -07:00
Sean DuBois
2155a7d703 Move candidate parsing to pion/ice
Instead of having logic in pion/webrtc and pion/sdp move all logic to
pion/ice. Users of pion/ice don't want to import these packages to use
basic pion/ice functionality.
2020-09-13 00:05:09 -07:00
soolaugust
c01b447517 Add signaling state case in CreateAnswer()
According to
https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createanswer.
If connection's signaling state is neither "have-remote-offer" nor
"have-local-pranswer", return a newly created InvalidStateError.
2020-09-03 13:46:46 -07:00
Woodrow Douglass
8090cca216 Refactor some PeerConnection Tests
This is to support the removal of implicitly
created data channels.
2020-07-29 12:57:37 -07:00
Atsushi Watanabe
0157f347e4 Fix randoms
Use seeded mathematical random where uniqueness is needed
but not required to be cryptographic.
2020-07-13 14:42:53 +09:00
Woodrow Douglass
baf14a9af4 Media Level Fingerprints Configuration Option
This commit adds an option to put DTLS Fingerprint specification
at the media description level rather then the session description
level. This enhances compatibility with some 3rd party webrtc
implementations (notably Kurento).
2020-06-30 01:37:15 -07:00
Sean DuBois
bbb6f374ff Fix race in TestPopulateLocalCandidates
Test would compare PendingLocalDescription while it was still gathering.
If a candidate trickled between calls it would fail the test.
2020-06-29 23:47:57 -07:00
Sean DuBois
f2941469f4 Implement ICE Restarts
Resolves #1251
2020-06-29 23:09:18 -07:00
Sean DuBois
bb3aa9717f Move to pion/ice@v2
Removed support for trickle ice

Resolves #1274
2020-06-28 00:01:47 -07:00
Sean DuBois
89d7de1787 Start /v3
See #9 for the features we have planned, and the breaking changes that
may occur.
2020-06-25 09:45:27 -07:00
Sean DuBois
7190581682 Copy ICEServers when creating new PeerConnection
Before ICEServers wasn't thread safe. If a Configuration
was shared among multiple PeerConnections the sanitization logic
could cause race conditions.

Resolves #1246
2020-06-10 00:16:43 -07:00
Jerko Steiner
8013159fff Add RTPTransceiver.Mid()
Refactor existing code for Unified Plan to ensure the same transceiver
will always be associated with the media description by mid.
2020-04-29 09:05:42 +02:00
Sean DuBois
234a170fb4 Only call iceGatherer.Gather once
In SetLocalDescription guard iceGatherer.Gather by checking state.
We don't put this check inside Gather because ORTC doesn't have the
function as re-entrant

Resolves #1144

Co-authored-by: jeremija
2020-04-19 07:50:11 +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
Yuki Igarashi
dba6716b39 Use AddTransceiverFromKind
Move from AddTransceiver to AddTransceiverFromKind.
2020-04-04 21:35:45 -07:00
Atsushi Watanabe
984d7c35dd Fix TestPeerConnectionTrickle
Fix AddRemoteCandidate target in the test code.
2020-04-04 17:37:10 +09:00
Atsushi Watanabe
76cae5a116 Add a test to check OnICECandidate order
Requires pion/ice#168 to pass the test.
2020-04-04 17:37:10 +09:00
Atsushi Watanabe
be9fde1fd3 Fix ICEGatherer state change callback order
Don't call handlers in goroutine to guarantee the ordering and
avoid changing internal state during callback.
2020-03-10 16:32:44 +09:00
Sean DuBois
573f9a3988 Don't add ICECandidate before SetRemoteDescription
Resolves #1029
2020-02-15 12:44:18 -08:00
Sean DuBois
2b212f8a7c Add E2E Trickle ICE Test
Resolves #1015
2020-02-10 22:21:46 -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
efe2c58d4e Add test for OnICEGatheringStateChange
Resolves #767
2020-01-30 00:19:32 -08:00
Sean DuBois
d10941f2a4 Add SettingEngine entries needed for offline sync
Allow users to set statice ICECredentials and to disable
DTLS Certificate Verification
2019-12-09 16:43:44 -08:00
Sean DuBois
2356373aac Fix all routine leaks in tests
Fix tests that didn't properly close and add
test.CheckRoutines everywhere. No changes in pion/webrtc
but we did catch hanging thread in pion/ice
2019-10-24 00:09:43 -07:00
Yutaka Takeda
7878bd8499 Fix goroutine leaks in the test
Bump pion/datachannel ver to 1.4.12
Resolves #895
2019-10-23 20:36:01 -07:00
Sean DuBois
7584762124 Expose Answering DTLSRole via SettingEngine
User can now control what DTLSRole the local client
takes when answering via the SettingEngine.

Relates to #880
2019-10-22 01:11:21 -07:00
Vicken Simonian
5f25df2209 Various spell fixes
For error types, vars, docs and comments
2019-10-17 23:31:21 -07:00
Vicken Simonian
27f93a7f3d Fix misspelled error types
ErrNoTurnCredencials => ErrNoTurnCredentials
ErrTurnCredencials => ErrTurnCredentials
2019-10-17 21:03:58 -07:00
Sean DuBois
305bddb654 Add test for invalid fingerprints
Assert that connection goes to failed if invalid fingerprint
is passed in SessionDescription
2019-09-15 21:01:47 -07:00
Sebastian Waisbrot
e0aab79044 Support running ICE lite locally and on a remote
* Parse ice-lite property from remote SessionDescription
* Add option to SettingEngine that allows the local ICEAgent to run
  in lite mode
2019-09-12 11:42:16 -07:00