Commit Graph

35 Commits

Author SHA1 Message Date
Sean DuBois
7fc6f5435b Stop discarding errors in setDescription
SetRemoteDescription was not properly returning errors. Fix and add test
to make sure we don't regress again in the future.

Resolves #1210
Resolves #1473
2020-10-15 22:23:09 -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
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
Kuzmin Vladimir
2c5819d521 Implement OnNegotiationNeeded
This event is fired when a change has occurred
which requires session negotiation.

Resolves #817
2020-08-19 14:37:18 -05: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
Sean DuBois
addb9594f2 Assert SDPType in setDescription
Before users could pass a SessionDescription with a 0 type. This would
be discarded silently. Now we return an error that matches browser
behavior.

Resolves #1297
2020-07-13 14:38:09 -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
Josh Bleecher Snyder
24877a4714 Fix broken link to issue in comment
Link incorrectly include /v2 to github repo
2020-06-06 13:28:16 -07:00
Jerko Steiner
b66c3c4903 Add operations queue for setting descriptions
Most likely fixes #1157
2020-05-13 22:00:52 +02:00
Egon Elbre
f4f8299694 Fix logging issue with fmt.Sprintf
log.Trace("%v") could end up logging "%!v(MISSING).
2020-04-11 21:43:41 +09:00
Sean DuBois
1f448413f2 Handle changing role during re-negotiation
On all subsequent re-offers make sure to order
of media sections.

Add TestPeerConnection_RoleSwitch to assert this behavior

Resolves #1058
2020-03-08 21:29:20 -07:00
Sean DuBois
efe2c58d4e Add test for OnICEGatheringStateChange
Resolves #767
2020-01-30 00:19:32 -08:00
Sean DuBois
3f2c36d153 Add PeerConnectionState
Start properly setting the PeerConnectionState and make
OnConnectionState available

Resolves #614
2019-09-15 21:01:47 -07:00
Sean DuBois
eb737ba0b2 Fix routine leak in drainSRTP
Store orphaned SRTP/SRTCP streams and discard them
when we close the PeerConnection

Resolves #729
2019-07-06 22:58:07 +01:00
AlexWoo(武杰)
3a15b2ccda Check all SDP media sections for a fingerprint
Fix RemoteDescription parsing so that it parses all sections when
looking for a fingerprint, before it would fail if the first section
did not contain one
2019-06-23 23:40:40 -07:00
Konstantin Itskov
8c7f769e86 Fix race issue caused by multiple gathering
resolves #707
2019-06-07 20:05:55 -07: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
Max Hawkins
7f6c01d5bc Move missing codec test to media_test
So it doesn't conflict with WASM.

Related to #449
2019-04-09 18:12:58 -07:00
Max Hawkins
141ef8b71a SDP: reject media tracks without matching codec
Previously the PeerConnection would create invalid SDPs
when answering an offer that contained codecs it didn't
know about. Now it rejects them by setting the media format
to 0.

Related to #449
2019-04-09 18:12:58 -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
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
Yutaka Takeda
f28fadae04 Change PC pubic properties to methods
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
Sean DuBois
005c731b9b Fix deadlock on DTLS shutdown
DTLS shutdown deadlocks if Close is called before startup completes,
because the DTLS connection hasn't finished yet we don't have handles
to close anything.

This updates DTLS to follow how SCTP is shutdown, by shutting down the
nextConn (ICE in this case) we can shutdown the subsystem. By closing
ICE first, DTLS (and then SCTP) close properly no matter what state
they are in.

Resolves #487
2019-03-07 11:48:40 +01:00
Michael MacDonald
5084ad3370 Move pkg/ice to internal/ice
Avoid exposing any non-standard API.
2019-03-01 08:07:42 -05:00
Sean DuBois
6aeb3425b0 Move to new Track API
See v2.0.0 Release Notes[0] for all changes

Resolves #405

[0] https://github.com/pions/webrtc/wiki/v2.0.0-Release-Notes#media-api
2019-02-25 23:44:09 -08:00
backkem
bf422e0c0a API: Avoid exposing pkg/ice
OnICEConnectionStateChange now return a ICEConnectionState instead of
ice.ConnectionState.
Resolves #422
2019-02-20 20:47:34 +01:00
Max Hawkins
6567fcafe7 Rename MacKey -> MACKey
Relates to #417
2019-02-18 11:47:05 -08:00
Max Hawkins
9d88f7c71a Rename Sdp -> SDP
Relates to #417
2019-02-18 11:47:05 -08:00
Max Hawkins
b2fcef18cf Test SetConfiguration with ICECandidatePoolSize
Also reformat unit test to add test names so it's easier to track
individual test cases in the table-driven test.

Increases test coverage in peerconnection.go. Enough for us to merge?

Relates to #408
2019-02-17 16:22:56 -08:00
Max Hawkins
0647ce9c26 Remove rtc prefix from filenames
Relates to #408
2019-02-17 16:22:56 -08:00