Commit Graph

88 Commits

Author SHA1 Message Date
Eric Daniels
b3856ffcfc Make onNegotiationNeeded conform to spec
- Removes non-canon logic
2024-06-24 11:04:51 -04:00
Eric Daniels
43a6a6996b Reset state machine after negotiationNeededOp
- Fixes #2774
2024-06-11 10:50:29 -07:00
David Zhao
e593588b47 Revert "Update module transport, srtp, ice and turn"
This reverts commit ea23dec2b9.
2023-09-08 15:06:27 -07:00
renovate[bot]
ea23dec2b9 Update module transport, srtp, ice and turn
ReplayDetector introduced a breaking change
2023-09-03 23:59:43 -04:00
Pouget-Abadie
1210046255 Upgrading pion/ice dependency 2023-05-14 21:42:24 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
cnderrauber
220b1f37ee Refine updateConnectionState
Make updateConnectionState consistent with
https://www.w3.org/TR/webrtc/#rtcpeerconnectionstate-enum
2023-03-03 15:35:49 +08:00
Sean DuBois
43d0c5b9b0 Make Transceiver Negotation more consistent
Today a remote `recvonly` transceiver can be satisfied by a `sendonly`
or `sendrecv` transceiver. However a remote `sendonly` transceiver can
only be satisfied by a `recvonly` transceiver.

This PR updates the answer handling code to be more consistent.
2023-02-09 21:39:18 -05:00
Steffen Vogel
eafdc7742a Use new pion/transport Net interface
This change adapts pion/ice to use a new interface for most network
related operations. The interface was formerly a simple struct vnet.Net
which was originally intended to facilicate testing. By replacing it
with an interface we have greater flexibility and allow users to hook
into the networking stack by providing their own implementation of
the interface.
2023-02-09 09:39:33 +01:00
Pion
c1467e4871 Update CI configs to v0.7.2
Update lint scripts and CI configs.
2022-04-27 23:00:19 -04:00
boks1971
8796a5c5a7 Use ICE role to set DTLS role in answer
When creating answer, check ICE role while determining DTLS role.
ORTC thread on how roles are set
https://github.com/w3c/ortc/issues/167#issuecomment-69409953

When remote is ice-lite and there is no answering role set,
the answer uses the default which is DTLS client. So 'setup'
is set as 'active' and answer sent.

But, when DTLS transport is started, it checks the ICE role
and sets itself as DTLS server (because remote is lite
and hence local agent becomes controlling ICE agent).

So, both sides end up being DTLS server and nobody sends
client hello.
2022-02-02 12:33:59 -05:00
Sean DuBois
157220e800 Run gofmt to add new build constraints
Also remove some 1.13 specific WASM code
2022-01-17 22:36:01 -05:00
Len
425f5c6cef Handle implicitly created inactive transceiver
If SetRemoteDescription is called with offer SDP which
has a=invalid, PeerConnection sets its transceiver direction
as recvonly. Fix direction recvonly to invalid.

Resolves #2050
2021-12-28 20:22:36 -05:00
Sean DuBois
6160e8033f Handle unknown ICE Candidate Transport
rfc8839#section-5.1 specifies that a WebRTC Agent MUST
ignore any name/value pairs it doesn't understand. When
we parse a candidate and it fails because we don't understand
the type we now log and continue.

Resolves pion/webrtc#1949
2021-12-15 15:58:48 -05:00
Sean DuBois
2699584e9a Handle unknown ICE Candidate Type
rfc8839#section-5.1 specifies that a WebRTC Agent MUST
ignore any name/value pairs it doesn't understand. When
we parse a candidate and it fails because we don't understand
the type we now log and continue.

Resolves pion/webrtc#1949
2021-12-15 13:37:34 -05:00
Renovate Bot
99452111ba Update module github.com/pion/ice/v2 to v2.1.14
Generated by renovateBot
2021-11-16 12:55:40 -05:00
cnderrauber
635bfd9cad Set prefer codec created by remote sdp
If a transceiver is created by remote sdp, then set
prefer codec same as offer peer.
For pion's codec match, it will use exact match
first, and then partial match. If patial match
only, the partial match codecs will become
negotiated codes. So it will be set prefer codec
when only exist partial match. And has same payload.

Add test cast for this.

refer to https://www.w3.org/TR/webrtc/#bib-rfc8829
2021-11-12 14:05:33 +08:00
digitalix
f93ea80d85 Revert "Make RTPTransceiver Stopped an atomic"
This reverts commit 6c3620093d.
This commit would cause sender.ReadRTCP() to never return
even when pc associated with this sender was closed.
The aftermath is leaked goroutines that will never stop.
2021-09-24 18:46:42 +01:00
Sean DuBois
6c3620093d Make RTPTransceiver Stopped an atomic
Add an accessor to make getting value easy. Also add
TestPeerConnection_SkipStoppedTransceiver. This commit also cleans
up RTPTransceiver creation. We used a helper function, when we should
have just used the provide constructor
2021-09-04 15:15:36 -04:00
Sean DuBois
8cbcb571c2 Use constants for MimeType
Replace VP8/H264/Opus string usage
2021-08-25 21:41:49 -04:00
Sean DuBois
0735efd344 Throw error earlier for RTPSender with no codecs
It isn't possible to send media if a MediaEngine has no codecs. This
catches a common misconfiguration issues that users find themselves in.

Resolves #1702
2021-08-15 07:54:53 -04:00
Sean DuBois
cffa6afc34 Rollback pion/rtp to v0
Resolves #1908
2021-08-02 18:05:45 -04:00
Sean DuBois
a67c66a0c5 Upgrade pion/rtp to v2
Also updates interceptor and srtp
2021-07-29 11:18:41 -04:00
Juliusz Chroboczek
ee255e8956 Avoid crash after a PC callback has been reset
We used to crash if a PC callback was reset, due to confusion
between a nil interface and an interface whose value is nil.

Fixes #1871
2021-07-07 10:28:26 -04:00
digitalix
7948437b0b Fixed deadlock in peerconnection.go
In some rare cases during ice connection stage
change may result in deadlock. This fix makes
iceConnectionState and connectionState atomic
which should prevent deadlock.
2021-06-20 14:50:43 -04: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
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
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
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
Sean DuBois
ff1bc32221 Don't leak ICETransport routines
We didn't properly pass a context to the ICE Agent. We would leak
routines if closed while connecting.
2020-12-13 17:18:04 -08:00
ZHENK
3eb51d8a09 Pass nil candidate into pion/ice
Pass empty string candidate.Candidate into pion/ice to handle.

Co-authored-by: JooYoung <qkdlql@naver.com>

Resolves #1212
2020-12-09 16:17:17 -08:00
Sean DuBois
9715626a0c Revert "Read/Write RTP/RTCP packets with context"
This change caused a ~24% performance decrease

Relates to pion/webrtc#1564

This reverts commit 47a7a64898.
2020-12-02 20:11:06 -08:00
Atsushi Watanabe
47a7a64898 Read/Write RTP/RTCP packets with context
Control cancel/timeout by context.
2020-12-01 11:08:48 +09:00
Sean DuBois
661f5b83dd Use Trickle ICE for TestICERestart
Test both paths
2020-11-16 22:48:44 -08:00
Sean DuBois
4a80d10fd8 Simplify TestNegotiationNeededStressOneSided
Test still asserts that `OnNegotiationNeeded` is able to signal all
500 tracks.
2020-11-16 19:06:25 -08:00
Sean DuBois
7edfb701e0 New Track API
The Pion WebRTC API has been dramatically redesigned. The design docs
are located here [0]

You can also read the release notes [1] on how to migrate your
application.

[0] https://github.com/pion/webrtc-v3-design
[1] https://github.com/pion/webrtc/wiki/Release-WebRTC@v3.0.0
2020-11-15 09:20:47 -08:00
Sean DuBois
79d93e9835 Add TestICERestart_Error_Handling
Add test that asserts that a DataChannel message that is sent while
disconnected will be delivered after reconnected.

Relates to #1518
2020-11-13 05:21:37 -08:00
Sean DuBois
43f3b47307 Revert TestICERestart_Error_Handling
We need to fix pion/ice#252 first
2020-11-12 23:51:49 -08:00
Sean DuBois
50e4975877 Add TestICERestart_Error_Handling
Add test that asserts that a DataChannel message that is sent while
disconnected will be delivered after reconnected.

Relates to #1518
2020-11-12 22:51:30 -08:00
Sean DuBois
89c51a156c Rename SettingEngine mDNS Config option
GenerateMulticastDNSCandidates -> SetICEMulticastDNSMode.
Before a user wasn't able to disable mDNS. By changing it we can
do more with this API.
2020-10-05 16:52:21 -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
mission-liao
062e55d769 Avoid acquiring two reader privilege of a lock
It's an anti-pattern when using sync.RWMutex in golang.
After acquiring two reader privilege of a rwlock, it will deadlock if
another routine tries to acquire a writer lock.

In pion/webrtc, this calling sequence might happen when calling
GetTransceivers during track events.

Resolves #1425
2020-09-19 13:26:03 -07:00
Sean DuBois
2155a7d703 Move candidate parsing to pion/ice
Instead of having logic in pion/webrtc and pion/sdp move all logic to
pion/ice. Users of pion/ice don't want to import these packages to use
basic pion/ice functionality.
2020-09-13 00:05:09 -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
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
Atsushi Watanabe
0157f347e4 Fix randoms
Use seeded mathematical random where uniqueness is needed
but not required to be cryptographic.
2020-07-13 14:42:53 +09:00
Woodrow Douglass
baf14a9af4 Media Level Fingerprints Configuration Option
This commit adds an option to put DTLS Fingerprint specification
at the media description level rather then the session description
level. This enhances compatibility with some 3rd party webrtc
implementations (notably Kurento).
2020-06-30 01:37:15 -07:00
Sean DuBois
bbb6f374ff Fix race in TestPopulateLocalCandidates
Test would compare PendingLocalDescription while it was still gathering.
If a candidate trickled between calls it would fail the test.
2020-06-29 23:47:57 -07:00
Sean DuBois
f2941469f4 Implement ICE Restarts
Resolves #1251
2020-06-29 23:09:18 -07:00