Commit Graph

44 Commits

Author SHA1 Message Date
Sean DuBois
dbde6114a2 Update import paths
Add /v2 to import paths everywhere
2019-04-07 02:17:15 -07:00
Sean DuBois
4c781e64d9 Return error on certificate fingerprint failure
Instead of printing the error to stdout return the error to the user.
This may not be a hard error (as later certificates would have passed)
but it never is good to be in a state where you have certificates in a
broken state.

Resolves #586
2019-04-05 00:48:22 -07:00
Sean DuBois
6e26cd208f Make SCTPTransport thread safe
Relates to #525
2019-04-04 21:28:37 -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
1202dbaa06 Migrate SDP generation to Unified Plan
This commit has breaking changes. This API change means we
can no longer support an arbitrary number of receivers. For every track
you want to receive you MUST call PeerConnection.AddTransceiver

We do now support sending an multiple audio/video feeds. You can see
this behavior via gstreamer-receive and gstreamer-send currently.

Resolves #54
2019-04-04 12:55:36 -07:00
Hugo Arregui
87897285b1 Custom Loggers
Define LoggerFactory as part of the SettingEngine
2019-04-01 11:14:13 -03:00
Sean DuBois
fe3d7ce5e4 Don't allow answer without RemoteDescription
Resolves #563
2019-03-31 15:58:50 -07:00
Sean DuBois
cc25f30bdb Don't iterate Transceivers without lock
Properly use locks when accessing Transceivers

Resolves #431
2019-03-31 12:14:40 -07:00
Sean DuBois
6c0e8b8851 Return io.EOF when Track has no RTPSenders
Using this enum allows people to more gracefully handle shutdown,
also add a test to assert io.EOF is returned in other places

Resolves #511
2019-03-31 12:00:40 -07:00
Max Hawkins
4298892dc0 Rename SendRTCP -> WriteRTCP
Makes method name consistent with WriteRTP

Fixes #557
2019-03-30 10:21:46 -07:00
Sean DuBois
776c551307 Don't notify users via Track of ICE errors
Writing to a Track shouldn't return errors for an individual
RTPSender. This filters ErrNoCandidatePairs from being returned
and instead just returns nil

Resolves #523
2019-03-29 17:16:35 -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
backkem
fe0e4d692b Move logging out of tree
Relates to #361
2019-03-21 12:48:57 +01:00
Luke Curley
205c759a69 Add feedback support to SDP generation
Syntax could be better but works in a standards-compliant way.

```
codec := webrtc.NewRTPH264Codec(webrtc.DefaultPayloadTypeH264, 90000)
codec.RTPCodecCapability.RTCPFeedback = []webrtc.RTCPFeedback{{
    Type: "nack",
}, {
    Type:      "nack",
    Parameter: "pli",
}}
```
2019-03-20 15:44:17 -07:00
Yutaka Takeda
f28fadae04 Change PC pubic properties to methods
Resolves #526
2019-03-19 10:48:33 -07:00
Yutaka Takeda
8bd831fafe Change public DataChannel props to methods
Resolves #505
2019-03-19 08:33:18 -07:00
Luke Curley
08a93d89ba Optimize Read by buffering
Increases the Read performance to acceptable levels. Packet loss went
from roughly 8% to 0.5% with this change.
2019-03-12 21:34:48 -07:00
Konstantin Itskov
d23ceed6d4 Add a customization to control network types
- Fix an issue with ipv6 srflx candidates gathering.
- Add SetNetworkTypes config to SettingEngine to control what network
  types are allowed to be connected.

Resolves #460
2019-03-12 21:36:52 -04:00
Alex Browne
0f1ddf0825 Add JavaScript/WASM bindings
Resolves #478. Adds minimal JavaScript/WASM bindings. This makes it
possible to compile core parts of pions/webrtc to WASM and run it in the
browser. Only data channels are supported for now and there is
limited/no support for certificates and credentials.
2019-03-08 00:26:17 +01:00
Michael MacDonald
c4f37ff2a7 Check for nil Receiver in PeerConnection.AddTrack
Relates to #476

Also check for a nil Receiver on the RTPTransceiver.
2019-03-07 16:55:19 -05: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
Sean DuBois
43604d5491 Remove pkg/errors dependency
Lots of people are paying attention to what dependecies we add to their
projects now. This just makes things a little cleaner.

Resolves #469
2019-03-06 09:34:10 -08:00
mxmCherry
abd6448925 Add RTPSender.hasSent helper
Mostly for PeerConnection.AddTrack RTPTransceiver filtering.

Also, removed nil-check for RTPSender.track:
1) RTPSender is always instantiated with PeerConnection.NewRTPSender
2) PeerConnection.NewRTPSender returns error if nil track passed
2019-03-06 00:08:11 +02:00
mxmCherry
8bd30e6d10 Nil-check for .Sender on PeerConnection.AddTrack
Resolves #476
2019-03-06 00:08:11 +02:00
Michael MacDonald
5084ad3370 Move pkg/ice to internal/ice
Avoid exposing any non-standard API.
2019-03-01 08:07:42 -05:00
Max Hawkins
e529e1469f Explicitly reject unsupported m= lines
CreateAnswer currently omits any m= lines from the offer that contain
unsupported codecs. The jsep spec says that unsupported lines in the
offer need to be explicitly rejected by setting the port number to 0.

Related to #449
2019-02-26 22:52:24 -08:00
Sean DuBois
0989344fe8 Allow multiple Tracks with the same ID
A PeerConnection is now able to mux multiple tracks. by removing this
resriction two tracks with the same ID are delivered to the client
muxed as one MediaStream.

Resolves #440
2019-02-26 00:14:10 -08:00
Luke Curley
31b7044955 Expose Encodings variable for ORTC
It's not possible to use a RTPReceiver without it.
2019-02-26 00:06:35 -08: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
Sean DuBois
bfba81167e Bump pions/sdp to v2.1.0
Resolves #nil
2019-02-22 02:18:15 -08:00
backkem
a1159049a1 Move RTPSender and RTPReceiver to API
Relates to #379
2019-02-22 09:42:50 +01:00
backkem
36cf0df239 Avoid defaultAPI
Relates to #434
2019-02-22 07:31:20 +01:00
backkem
0e619e2fb2 API: Use ICECandidateInit in AddICECandidate
Resolves #358
2019-02-21 07:09:35 +01: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
Yutaka Takeda
31fa14cd0d Removed unnecessary comments
Resolves #334
2019-02-18 21:27:31 +01:00
Yutaka Takeda
e35dc55da9 Code optimization per code review
Resolves #334
2019-02-18 21:27:31 +01:00
Yutaka Takeda
4dc68ed0da Wire reliability params to datachannel
Resolves #334
2019-02-18 21:27:31 +01:00
Max Hawkins
9cba54cfd0 Upgrade to pions/sdp v2
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
c6592e6c4b Rename Ssrc -> SSRC
This capitalization is consistent with other uses in the project,
and matches the Go convention of capitalizing initialisms.

https://github.com/golang/go/wiki/CodeReviewComments#initialisms

Relates to #417
2019-02-18 11:47:05 -08:00
Sean DuBois
632b16b852 Update golangci-lint to v14.0.0
Update linter to newest version and fix all new issues
2019-02-17 21:35:04 -08:00
Will Watson
8141bba1a1 Enable gocritic and fix reported errors
This change enables the gocritic linter and fixes all reported errors.
2019-02-17 21:35:04 -08:00
Max Hawkins
0647ce9c26 Remove rtc prefix from filenames
Relates to #408
2019-02-17 16:22:56 -08:00