Commit Graph

2053 Commits

Author SHA1 Message Date
Pion
7a71cc62d1 Update CI configs to v0.4.24
Update lint scripts and CI configs.
2021-04-20 16:30:24 -07:00
cnderrauber
eeb67e1c53 Fixes MediaEngine: codec apt negotiation
codec has apt fmtp can't negotiation because it's
apt payloadtype can't be found in negotiation codecs.
2021-04-20 09:04:38 -07:00
Sean DuBois
91a12e8cfb Hold lock when accessing remote description
CurrentRemoteDescription and PendingRemoteDescription both access
members of the PeerConnection that should be protected by a lock.

Co-authored-by: Markus Tzoe <chou.marcus@gmail.com>
2021-04-17 11:32:30 +08:00
Markus Tzoe
a1380456a8 Fixes peerconnection: potential deadlock
in CurrentLocalDescription() or PendingLocalDescription():
when gathering local candidates in populateLocalCandidates(),
agent would try submitting a task via run():

	a.chanTask <- task

the chanTask is consumed by a bg routine using taskLoop():

	for {
		select {
		case <-a.done:
			return
		case t := <-a.chanTask:
			t.fn(a.context(), a)
			close(t.done)
			after()
		}
	}

while there're other routines using the agent, e.g. calling
`agent.updateConnectionState()`

	a.afterRun(func(ctx context.Context) {
		a.chanState <- newState
	})

and the submitted task would be run by the `after()` func in
`taskLoop()`, where the `a.chanState` is handled by
`agent.startOnConnectionStateChangeRoutine()`

this `after()` task may block the bg routine when there's ongoing
event handler `agent.onConnectionStateChange()`, which would
eventually call PeerConnection's onICEConnectionStateChange():

	pc.mu.Lock()
	pc.iceConnectionState = cs
	handler := pc.onICEConnectionStateChangeHandler
	pc.mu.Unlock()

which would try to hold the PeerConnection lock, causing deadlock
2021-04-16 20:00:35 -07:00
Renovate Bot
b466056711 Update module github.com/pion/ice/v2 to v2.1.2
Generated by renovateBot
v3.0.22
2021-04-16 10:43:23 -07:00
Renovate Bot
ce6100e75c Update golang Docker tag to v1.16
Generated by renovateBot
2021-04-15 21:45:05 -07:00
cgojin
f81efb0a13 Use wasm_exec.js in GOROOT
Use wasm_exec.js in GOROOT to ensure that the wasm file be loaded,
there is no need to use a specific version of go to build wasm,
and delete vendor-wasm.
2021-04-15 20:44:29 -07:00
David Zhao
d0a52518b0 Introduce UDPMux in SettingsEngine, single-port
When set, Pion will handle ICE connections over UDPMux
2021-04-15 10:49:14 -07:00
Markus Tzoe
fb4b5826ae Fixes SDP session id
SDP session id should stay unchanged for subsequent offers/answers
2021-04-15 06:19:26 +08:00
Markus Tzoe
a0b3117680 RtpTransceiverInit => RTPTransceiverInit
since RtpTransceiverInit is deprecated
2021-04-15 06:19:26 +08:00
Tomek
9b859870c0 Implement WASM Media methods
Add AddTransceiverFromKind and GetTransceivers. This doesn't support
everything, but enough to at least build a recvonly experience.

Resolves #500
2021-04-12 18:55:56 -07:00
Sean DuBois
4358bb9925 Implement GetSelectedCandidatePair
Resolves #1713
2021-04-11 11:05:27 -07:00
Sean DuBois
525d725846 Unexport ICETransport.NewEndpoint
This is a Pion-ism that accidentally was exported.
2021-04-11 11:05:27 -07:00
Sean DuBois
e2fd97b053 Make default certificate lifetime 30 days
This matches the W3C spec for generateCertificate. In the future we will
add an argument that lets the user pass a max of 1 year.

Relates to c6c241
2021-04-10 11:56:20 -07:00
Benny Daon
c6c241d57c Add CertificateFromPEM and PEM() to Certificate
Allow for easier usage of a pre-existing certificate
2021-04-10 19:05:18 +03:00
Sean DuBois
1cd8bbae2c Add Office Hours to README
Put under 'Learn more about WebRTC'
v3.0.21
2021-04-08 14:53:56 -07:00
Markus Tzoe
338dfa81f1 SCTPTransport: add association()
use assocation() instead of accessing private struct member from
outside
2021-04-06 20:54:46 -07:00
Markus Tzoe
2f77a28dca Fixes DataChannel panic on sctptransport race
DataChannel.open would panic during which if PeerConnection is closed,
stopping underlying sctpTransport which sets association to nil;

And ensureSCTP() method doesn't guarantee sctpTransport's availability
out of it's own scope.
2021-04-05 22:06:24 -07:00
Renovate Bot
38d35c6ff0 Update module github.com/pion/dtls/v2 to v2.0.9
Generated by renovateBot
2021-04-03 11:07:27 -07:00
Markus Tzoe
56ef4b73c5 PeerConnection: make AddTrack thread-safe
Use fine granularity rw-mutex to protect rtpTransceivers and for
exclusively accessing AddTrack and RemoveTrack

Fixes `shouldAddCandidates` typo in sdp.go
2021-04-03 10:51:19 -07:00
Renovate Bot
22bd93fd7b Update golang.org/x/net commit hash to 0fccb6f
Generated by renovateBot
2021-04-01 13:23:31 -07:00
OrlandoCo
e1c6662934 Add WriteRTCP method to DTLSTransport
This will make possible to WriteRTCP using ORTC API
v3.0.20
2021-03-31 20:56:09 -07:00
Renovate Bot
fb988c5781 Update module github.com/pion/sctp to v1.7.12
Generated by renovateBot
2021-03-23 10:45:52 -07:00
Sean DuBois
dab8a4a104 Handle errors properly in mux readLoop
Before io.ErrShortBuffer and packetio.ErrTimeout would incorrectly end
the read loop. Now they are only printed.

Resolves #1720
v3.0.19
2021-03-22 11:16:11 -07:00
Sean DuBois
9c345e24b6 Remove unused functions from internal/mux
Related to #1720
2021-03-22 11:16:11 -07:00
Pion
56c926f20c Update CI configs to v0.4.22
Update lint scripts and CI configs.
2021-03-21 22:04:34 -07:00
Jerko Steiner
6465248f1e Fixes for pre-added recvonly transceivers
Which were previously unable to:

1. have a sending track set to them, or
2. receive a track after renegotiation.

I'm not 100% sure if this covers all cases where a track is added and
removed and then added again. BUT IIRC there was a change that did not
allow transceiver reuse after a track was removed from it. Again, not
100% sure.

Fixes #1722.
v3.0.18
2021-03-21 11:50:52 +01:00
Atsushi Watanabe
07d7403cca Parse and compare FmtpLine on codec select
Exact match if fmtp parameters are not inconsistent.

e.g. default OPUS fmtp of the browsers are:
  Chrome:  minptime=10;useinbandfec=1
  Firefox: maxplaybackrate=48000;stereo=1;useinbandfec=1
They should be treated as matched.
v3.0.17
2021-03-21 13:41:33 +09:00
Atsushi Watanabe
7e952c73b5 Unbind interceptors on stop
Make resources used by interceptor bindings freed.
2021-03-21 09:03:37 +09:00
Sean DuBois
31d90467ae Update examples/broadcast README
Be more explicit about where `YOUR_SDP` comes from

Relates to #1019
2021-03-20 14:12:55 -07:00
Renovate Bot
3db4730166 Update module pion/interceptor to v0.0.11
Generated by renovateBot
v3.0.16
2021-03-19 13:45:59 +09:00
Renovate Bot
d27f90c674 Update module github.com/pion/ice/v2 to v2.0.16
Generated by renovateBot
2021-03-19 13:30:18 +09:00
Atsushi Watanabe
7d9a9d1bf7 Tidy go.sum
go mod tidy
2021-03-19 13:05:27 +09:00
Sean DuBois
545613dcde Close DTLS when fingerprint verification fails
Before we would set the PeerConnection to failed, but we would leave the
DTLSTransport. This means that a user could still interact with the
other transports.

Relates to #1708
v3.0.15
2021-03-17 16:48:08 -07:00
Sean DuBois
c901d6f005 Update TestInvalidFingerprintCausesFailed
Have the test assert both peers. Nothing was broken, we just didn't have
coverage on both paths.

Resolve #1708
2021-03-17 15:57:06 -07:00
Nam V. Do
4942778101 Fix typo in examples
retuned -> returned
2021-03-16 09:44:42 -07:00
Renovate Bot
d29548ca03 Update module github.com/pion/srtp/v2 to v2.0.2
Generated by renovateBot
v3.0.14
2021-03-06 09:27:32 -08:00
Renovate Bot
d411d03e95 Update golang.org/x/net commit hash to e18ecbb
Generated by renovateBot
2021-03-04 09:46:01 -08:00
Renovate Bot
8fcff49dfd Update module github.com/pion/dtls/v2 to v2.0.8
Generated by renovateBot
v3.0.13
2021-03-04 09:15:59 -08:00
David Zhao
e5c8c659ca Improve MediaEngine codec matching
Implement more sophisticated matching to prefer exact
matches over partial ones.
2021-03-04 09:08:59 -08:00
Juliusz Chroboczek
c3ba92bf4a Add json:omitempty tag to webrtc.Configuration
The peerIdentity field can be null, in which case the peer identity
is not checked.  We used to send the empty string in that case, which
happens to work with common browsers but is probably incorrect.
2021-02-27 09:01:36 -08:00
Sean DuBois
33d953e1eb Enable Sender and Receiver Reports by default
The play-from-disk examples sees the average bitrate using
Chromium 90.0.4412.3 when enabled on loopback for a 3 minute
session.

Before: 744.443
After: 3927.669

Introduced with pion/interceptor@v0.0.10
v3.0.12
2021-02-23 22:35:15 -08:00
aler9
ae0f74edff Set answer as sendonly in case of a recvonly offer
When a local peer connection has a single transceiver with a sendrecv
direction, and the remote has a transceiver with a recvonly direction,
the local peer connection must change the transceiver direction to
sendonly.

When a local peer connection has a single transceiver with a recvonly
direction, and the remote has a transceiver with a recvonly direction,
the local peer connection must create another transceiver with a
sendonly direction.

A unit test is added to cover all possible cases.
2021-02-22 15:23:27 -08:00
Reese
8cb5bde7c9 Fix error checking in pion-to-pion
Example was checking wrong error in conditional.
2021-02-19 10:05:32 -08:00
donotanswer
8e8567040c Update ice-lite remote check to ignore whitespace
When parsing SDP, ice-lite attributes with whitespaces
were parsed incorrectly. This fix trims whitespaces.
2021-02-19 09:10:28 -08:00
Renovate Bot
11ee5d54d5 Update module pion/dtls/v2 to v2.0.7
Generated by renovateBot
v3.0.11
2021-02-17 07:05:49 -08:00
mission-liao
8474033059 Fix updateHeaderExtension for cloned MediaEngine
It addresses the issue that unable to updateHeaderExtension for cloned
MediaEngine, which is resulted from previous commit:

c8b7aa386a
2021-02-17 18:10:19 +08:00
Renovate Bot
19537f2807 Update module pion/dtls/v2 to v2.0.6
Generated by renovateBot
v3.0.10
2021-02-16 15:52:52 -08:00
Sean DuBois
9c7b365144 Use closePairNow in tests
Instead of explicitly closing each PeerConnection use helper.
No change in test behavior, just makes code more consistent.
2021-02-16 15:47:58 -08:00
Juliusz Chroboczek
026ffcd27c Use a pool in Write and WriteRTP
This avoids one allocation for every write.
2021-02-16 15:27:25 -08:00