Commit Graph

103 Commits

Author SHA1 Message Date
Sean DuBois
77c6e3b827 Properly sanitize STUN urls
Currently we error if a STUN URL passed to Configuration.ICEServers
contained a query parameter. Fix this by using the getICEServers
function that sanitizes these for us.
2019-12-11 00:18:39 -08:00
Yutaka Takeda
7d99edd21a Added logging throughput
Resolves #778
2019-12-08 01:03:17 -08:00
Sean DuBois
bba6460597 Allow user to Close DataChannel before signaling
Match W3C WebRTC and allow a DataChannel to close even before
signaling happens. When SCTPTransport opens make sure
to check the readyState first.
2019-11-25 17:18:47 -08:00
Sean DuBois
1c32bc9a46 Properly set DataChannel readyState on Close
DataChannel readyState should be set to Closed on PeerConnection
shutdown. If not properly set it would attempt to interact with
state that doesn't exist after the PeerConnection has been Closed.

Setting the readyState is also clearly defined in the W3C webrtc-pc

Resolves #915
2019-11-22 18:06:43 -08:00
Sean DuBois
36b02632d1 Match W3C when closing
PeerConnection.Close() doesn't match the W3C RFC on closing,
re-order the transports so that they close in the proper order.

In the future we will use the DTLS Close alert and RTCP Bye to
better communicate shutdown
2019-11-21 11:55:48 -08:00
Sean DuBois
b5154b499e Only create ICEGather via API
Use values directly from SettingValues instead of just copying
when calling NewICEGatherer. This greatly reduces the LoC and makes
the public API a little cleaner.

Resolves #872
2019-11-21 11:18:05 -08:00
Sean DuBois
721b342e2e Properly generate DataChannel streamId
Before we computed DataChannel IDs before signaling, this
is incorrect because IDs must take into account if we are
running an DTLS Client or Server.

This updates the DataChannel ID generation code to take this
into account before generating a streamId.

Resolves #908
2019-11-14 10:51:05 -08: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
Sean DuBois
c6ad8c78ea Handle undeclared SSRCes
If we receive an unknown SSRC and we have a single
media section with no SSRCes declared fire an OnTrack
with that stream

Resolves #880
2019-10-20 02:05:43 -07:00
Vicken Simonian
5f25df2209 Various spell fixes
For error types, vars, docs and comments
2019-10-17 23:31:21 -07:00
Sean DuBois
92867d3de6 Support negotiated DataChannels in Go
Relates to #748
2019-09-28 22:34:57 -07:00
Sean DuBois
d692ddfa54 Support DataChannel protocol in Go
Relates to #748
2019-09-27 16:19:49 -07:00
Chris Hiszpanski
69dffdf4b5 Fix answer bundle for rejected media
When rejecting media, the identification-tag (i.e. media ID) must
be removed from the bundle in addition to setting the m-line port
to zero.
2019-09-26 19:35:55 -07:00
Sean DuBois
bf66a69c78 Make updateConnectionState idempotent
Pass in the state of transports instead of querying inside the function

Resolves #614
2019-09-15 21:01:47 -07: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
dbca703798 Don't return event status if unused
In lots of our event handlers we return the event status.
This is so we can know if the callee has finished. In lots
of cases we don't care so get rid of them to simplify the code.
2019-09-15 21:01:47 -07:00
Sean DuBois
bc46e8d43b Remove indirection from ICEConnectionState setter
Combine two functions that always call each other
2019-09-14 16:53:17 -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
Cecylia Bocovich
25b173aac1 Allow gathering of candidates to generate offer
A change was recently made to the SetLocal and SetRemoteDescription
functions for PeerConnection that starts ICE gathering for the trickle
method only when generating an answer. This means clients generating an
offer to initiate signaling will stall indefinitely.
2019-09-05 17:15:56 -04:00
Hugo Arregui
ec6c432dc8 Add ICE transport and SCTP transport stats
bytes received, bytes sent
2019-08-22 18:31:17 +00:00
Aaron France
b5fd3ead93 Remove duplicated code in CreateDataChannel
options.Ordered is processed twice for no reason
2019-08-20 03:11:01 -07: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
7f3000d9a6 Parse DTLS setup in SetRemoteDescription
Take into consideration if remote is running DTLS as a
client/server. Before we ignored this value and we could
enter cases where DTLS would never connect.

Resolves #494
2019-08-12 22:05:13 -07:00
Hugo Arregui
d64f1008de Offer sdp setup=actpass for datachannel
Fixes https://github.com/pion/webrtc/issues/686
2019-08-09 12:25:20 -07:00
Sean DuBois
0d585106c0 Add examples/play-from-disk
Using IVFReader demonstrate how users can stream a video
from hard disk to browser.

Relates to #636
2019-08-08 16:44:50 -07:00
Mike Coleman
4095d2cde9 Fix for Safari and latest Firefox
This fixes the echo program so it works properly on Safari
and Firefox, where the preferred offered dynamic media type
is not 96/VP8. It loads MediaEngine with codecs found in the
offer and then uses the payload type of the offer's preferred
video codec in the answer.
2019-08-07 11:53:42 -07:00
Hugo Arregui
7c18bbccee Add ToJSON ICECandidate method
With this change we can always exchange ICECandidateInit when signaling
2019-07-31 12:44:22 +00:00
Rafael Viscarra
1464ad4131 Implemented AddTransceiverFrom* methods
This allows to have SendOnly transceivers while keeping the API
relatively consistent with the browser's
2019-07-31 01:57:17 -06:00
Sean DuBois
b205912701 Ticket SCTP TODOs
Currently we log some errors that should stop the PeerConnection
Also get rid of port value, this doesn't have any value for
us

Relates to #106
2019-07-27 09:35:55 -07:00
Sean DuBois
8dfbafbcdd Update TODOs around multiple certificates
We are blocked by pion/dtls not support multiple certificates.
I have created an issue in GitHub issues for WebRTC and DTLS

Relates to #106
2019-07-27 09:35:55 -07:00
Sean DuBois
6d9bffeaa7 Remove resolved TODO from WriteRTCP
This behavior is fine. RTCP is lossy communication, so the caller
should should be ready to send packets multiple times if reception
is mandatory

Relates to #106
2019-07-27 09:35:55 -07:00
Sean DuBois
2f4049b15a Replace TODOs in PeerConnection with issues
Update all TODOs with issues in github

Relates to #106
2019-07-22 21:31:39 -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
584bd651c1 Delete unimplemented stubs
We will implement these eventually, but for now just delete them.
We need to explore how we can automatically figure out what parts
of WebRTC we haven't implemented yet.

Relates to #106
2019-07-22 21:31:39 -07:00
Sean DuBois
9e4b41838e Remove no-op code from shutdown
Don't manually set the ICEConnectionState in Close. This
value is being set by pion/ice when we call Close on it already

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
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
Hugo Arregui
93261960b1 Basic stats
Load DC, CandidatePair and Candidate basic stats
2019-06-25 19:36:57 +00: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
Sean DuBois
be3d922fbb Add mDNS Host Candidate support
This only does parsing, does not generate them.
In the future this option will be exposed via the SettingEngine,
including the ability to opt out of mDNS completely for security/scaling
concerns

Relates to pion/webrtc#699
2019-06-21 10:13:27 -07:00
mchlrhw
dc49947963 Fix panic in openSRTP
Implement fix by logging and bailing out if the local description has
not been set by the time we start receiving data from the other peer.

Fixes #563
2019-06-18 10:30:36 +01:00
Sean DuBois
2838b1a836 Move ICE code out of internal
Users are unable to use the callbacks inside `internal/ice`.
Even though we alias things like OnSelectedCandidatePairChange
are unusable since in the package they use `ice.Candidate` instead of
`ICECandidate`
2019-06-15 01:29:08 -07:00
Sean DuBois
0d773a38f6 Don't error when no candidate pairs
Fix inconsistency with error handling when we have no candidate pairs.
Before we had custom code in RTP handling that would discard errors
if it was because we had no candidate pairs. Move this logic into the
mux so we have consistent behavior with Datachannels

This can be expected and is a soft failure. Every subsystem is expected
to handle lossy communication.

Resolves #706
2019-06-08 17:51:18 -07:00
Konstantin Itskov
8c7f769e86 Fix race issue caused by multiple gathering
resolves #707
2019-06-07 20:05:55 -07:00
Adam Kiss
7756848a4c Moved ice related files to internal/ice
Moved ice related files to internal/ice. Added ice.go and
ice_go.go files containing aliases to internal/ice. Added
internal/tools/gen/genaliasdocs.go helper script for generating the
documentation for these aliases. Dropped ice
prefix from file names in internal/ice package.
2019-06-03 10:57:27 -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
Adam Kiss
8289a3e7cc Prepare for internal/ice package
Removed SDP dependency from ice files. Exported string to ice enum
functions. Exported ICEServer.Validate.
2019-05-26 14:09:38 +02:00
Sean DuBois
b2049be130 Support ICETransportPolicy
Add support for ICETransportPolicy and ICEGatherPolicy for ORTC
2019-05-26 00:54:43 -07:00
Sean DuBois
85a1602698 Populate incoming Label/ID
Populate the Label/ID for incoming tracks. Before we
emitted them to the user with empty values

Resolves #670
2019-05-12 00:55:37 -05:00