Commit Graph

56 Commits

Author SHA1 Message Date
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
Hugo Arregui
6997cc792c Linter fixes
Disable funlen and some fixes

Co-authored-by: Sean DuBois <sean@siobud.com>
2019-09-10 21:48:25 -07:00
Sean DuBois
9fa65c2147 Add TestGatherOnSetLocalDescription
Assert that SetLocalDescription always starts ICE candidate
gathering. #763 broke this behavior (and diverted from the RFC)
by starting gathering in SetRemoteDescription in some cases.

Fixes #763
2019-09-07 02:19:43 -04:00
Suhas Gaddam
f36c437056 Remove dupe of setup attribute in SDP creation
Before a:setup=actpass was showing up twice in each media description.
It is already being added in the addTransceiverSDP and
addDataMediaSection methods. This commit removes the extra call.
2019-08-13 23:17:16 -07:00
Sean DuBois
775a521176 Don't store transceiver MID
These are generated at runtime (depending if we are doing Plan-B or
Unified Plan). Currently this field is actually unused, so just getting
rid of it.

Relates to #106
2019-07-22 21:31:39 -07:00
Sean DuBois
2228e7f61e Add custom-logger example
Demonstrate how users can user their own logger via the
SettingEngine

Resolves #726
2019-07-11 20:24:07 +01:00
Sean DuBois
10d2ca3d88 Enable gochecknoglobals linter
Resolves #434
2019-07-09 23:31:56 +01:00
Sean DuBois
1d721199ef Add ICE Trickle support
Resolves pion/ice#51

Co-authored-by: Konstantin Itskov <konstantin.itskov@kovits.com>
2019-05-29 17:15:28 -07:00
Christopher Fry
54c3a4c672 Allow remote Sendrecv to be used with Recvonly
Before our RTPTransceiver logic would only allow Sendrecv to
match with another Sendrecv. Instead allow a SendRecv to be used
with a local Recvonly

Co-authored-by: Sean DuBois <sean@siobud.com>
2019-04-18 21:32:10 -07:00
Sean DuBois
dbde6114a2 Update import paths
Add /v2 to import paths everywhere
2019-04-07 02:17:15 -07:00
Sean DuBois
1cdfc10c84 Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 15:32:03 -07:00