Commit Graph

35 Commits

Author SHA1 Message Date
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
Sean DuBois
fe3d7ce5e4 Don't allow answer without RemoteDescription
Resolves #563
2019-03-31 15:58:50 -07:00
Sean DuBois
b4bc4798b9 Move ICE out of tree
Relates to #361
2019-03-25 23:31:43 -07:00
Alex Browne
5ee8b1a5c5 Add ICE candidate event handlers
Add OnICECandidate and OnICEGatheringStateChange methods to
PeerConnection. The main goal of this change is to improve API
compatibility with the JavaScript/Wasm bindings. It does not actually
add trickle ICE support or change the ICE candidate gathering process,
which is still synchronous in the Go implementation. Rather, it fires
the appropriate events similar to they way they would be fired in a true
trickle ICE process.

Remove unused OnNegotiationNeeded event handler. This handler is not
required for most applications and would be difficult to implement in
Go. This commit removes the handler from the JavaScript/Wasm bindings,
which leads to a more similar API for Go and JavaScript/Wasm.

Add OnICEGatheringStateChange to the JavaScript/Wasm bindings. Also
changes the Go implementation so that the function signatures match.
2019-03-25 14:22:11 -07:00
Alex Browne
012a7ea686 Improve build tags for Wasm
Fixes #515

This includes a few small and closely related changes:

1. All occurrences of the build tag `+build js` have been changed to the
   more precise `+build js,wasm`. This will exclude the files from being
   included by third-party compilers like GopherJS, with which they are
   incompatible.
2. Some files which are incompatible with JavaScript/Wasm now have the
   correct build tag (`+build -js`) so they will be excluded from Wasm
   builds.
3. Some configuration options which are incompatible with
   JavaScript/Wasm (or at least the current bindings) will now no longer
   appear in Wasm builds. This meant creating new files with new struct
   definitions and the appropriate build tags.
2019-03-22 10:48:03 -07:00
Yutaka Takeda
8c36225dbc Moved the getter tests to peerconnection_go_test
Resolves #526
2019-03-19 10:48:33 -07:00
Alex Browne
34e5a89f71 Add tests for WASM bindings
The tests are run in a Node.js environment, and this does not include
any browser tests. This requires the wrtc package from npm as well as a
shim which adds portions of the WebRTC API to the global scope.

Some tests introduced here can be combined when differences between the
Go API and the WASM bindings are addressed and as missing features are
added to the WASM bindings.

We can and should add more tests in the future to improve test coverage.
This should be considered the minimum number of tests reuqired to ensure
basic functionality is working.
2019-03-15 15:17:51 -07:00