Commit Graph

54 Commits

Author SHA1 Message Date
Joe Turki
feeeebf251 Upgrade golangci-lint, more linters
Introduces new linters, upgrade golangci-lint to version (v1.63.4)
2025-01-18 07:16:06 -06:00
cnderrauber
e6a86e74b9 Don't reuse transceiver in one round negotiation
Should not reuse transceiver (remove & add track)
in one round negotiation, it cause the transceiver
changes ssrc/id without transit to inactive and the
remote peer connection can't fire track close and
OnTrack event.
2024-09-06 14:55:33 +00:00
Sean DuBois
c85269bee3 Properly handle non-media probes
libwebrtc has started sending media probes on an unannounced SSRC(0).
Currently Pion will ignore this as the SSRC hasn't been declared
explicitly and no RID/MID RTP Headers.

This adds a special case to accept SSRC 0 and Read the RTP packets. This
allows the TWCC reports to properly be generated.
2024-07-20 22:16:22 -04:00
Sean DuBois
9c6604df0a Drop calls to RegisterDefaultCodecs in tests
Not needed anymore
2024-07-18 16:14:23 -04:00
Sean DuBois
fda6c4f836 Fix linter errors
golangci-lint upgrade to v1.56.2 added more checks

Relates to pion/.goassets#201
2024-03-16 21:09:38 -04:00
Sean DuBois
34fe40e38b Remove deprecated APIs
Delete everything that was marked as deprecated
2023-09-14 14:15:40 -04:00
Sean DuBois
b549c9580d Enable Simulcast RTP Headers by default
Relates to #2557
2023-09-13 12:38:26 -04:00
Aleksandr Alekseev
e507d46e1c Improve checkNegotiationNeeded replaceTrack
replaceTrack with nil would cause a crash
2023-09-08 14:08:02 -04:00
Sean DuBois
dc4b591c4d Start pion/webrtc/v4
60eea43 is a breaking change
2023-09-05 11:48:14 -04:00
renovate[bot]
ea23dec2b9 Update module transport, srtp, ice and turn
ReplayDetector introduced a breaking change
2023-09-03 23:59:43 -04:00
Hao
1390b16097 Fix typo 'Renegotation' across project
'Renegotation' -> 'Renegotiation'
2023-08-24 14:14:29 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
Sean DuBois
595f1c03d1 Move negotation test out of peerconnection_test
No functional change
2023-03-08 10:11:11 -08: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
cnderrauber
3c802f7169 Reuse passive created sendonly transceiver
When peerconnection create a transceiver by remote's recvonly
offer, the transceiver will have nil sender but can't be reused
since its currentDirection is set to sendonly. This pr change
the currentDirection to inactive so it can be reused by AddTrack.
2023-01-31 19:18:35 +01:00
Jerko Steiner
5b41ed600e Revert "Revert "Add currentDirection to RTPTransceiver""
This reverts commit a92c400e5a.
2023-01-28 13:39:58 +01:00
Jerko Steiner
a92c400e5a Revert "Add currentDirection to RTPTransceiver"
This reverts commit 045df4c4bf.
2023-01-28 13:37:08 +01:00
cnderrauber
81376b2ca8 Fix generated Mid conflict with user set Mid
Inside one cycle renegotiation, if user both has manually set Mid
and auto generated Mid for transceivers, CreateOffer will failed
for Mid conflict.
2022-09-30 14:54:41 +08:00
cnderrauber
045df4c4bf Add currentDirection to RTPTransceiver
add currentDirection to RTPTransceiver, don't reuse
transceiver if its currentDirection is sendrecv or sendonly
2022-09-15 09:24:56 +08: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
37e16a3b15 Bolting on send side simulcast
Introduces AddEncoding method in RTP sender to add simulcast encodings.

Added UTs for AddEncoding.
Also modified the Simulcast send test to use the new API.
2022-02-24 23:55:17 -08:00
Sean DuBois
664f6df0d3 Add test for 65b517
Assert that Simulcast probe thread doesn't close the Tracks that have
been emitted to the user.
2022-02-01 19:03:00 -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
boks1971
f5840a7dc8 Fix Simulcast + non-simulcast remote tracks
Problem:
--------
In the following negotiation sequence, the Simulcast track is lost.
1. Remote Offer with Simulcast tracks with rids
2. A new track added to Remote Offer with tracks using SSRCs

When the updated `offer` is received, the Simulcast transceiver's
receiver gets overwritten because the tracks from SDP is compared
against current transceivers. The current transceiver for the
Simulcast track already had SSRCs set as media has been received.
But, tracks read from the SDP only has `rid`. So, no current
transceiver matches and hence a new receiver is created which
clobeers the good Simulcast receiver.

Fix:
----
- Prioritize search by `rid`.
- Also found a case of a loop where the index was missing entries
in the loop. Fix it.

Testing:
--------
- The above case works
2021-10-15 11:21:16 -04:00
Sean DuBois
7e5b9c320f Implement Simulcast Track shutdown
Write tests for a Simulcast transceiver going to inactive and mid
changing
2021-09-02 15:31:11 -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
Markus Tzoe
b6ca48ea6d PeerConnection: more thread-safe
now proctected by lock:
	- CreateOffer
	- CreateAnswer
	- AddTransceiverFromKind
	- AddTransceiverFromTrack

newRTPTransceiver is no longer a PeerConnection method;
pc.addRTPTransceiver would fire onNegotiationNeeded;
pc.AddTrack, pc.RemoveTrack now hold lock for the entire function;

Fixes TestNegotiationNeededStressOneSided() by waiting til all
tracks added to pcA and the negotiation completed
2021-04-23 11:12:48 +08:00
Markus Tzoe
a0b3117680 RtpTransceiverInit => RTPTransceiverInit
since RtpTransceiverInit is deprecated
2021-04-15 06:19:26 +08: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.
2021-03-21 11:50:52 +01: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
67826b1914 Update Interceptors to use []byte based API
Also update test to assert Attributes get passed all the way through

Resolves pion/interceptor#14
2020-12-13 18:40:33 -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
29f8b446de Simplify TestNegotiationNeededStressOneSided
Remove network interaction from test, just assert that
answerer gets all the expected Transceivers
2020-11-16 21:13:55 -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
ec2658440e Simplify TestNegotiationTrackAndChannel
We already have extensive tests for tracks. Update this test
to just assert that CreateDataChannel fires OnNegotiationNeeded.
2020-11-12 15:52:44 -08:00
Sean DuBois
7b72d684e5 Handle Remote offer with inactive media section
If a remote Offer stops a mid make sure we
also stop the corresponding mid locally.

Resolves #1470
2020-10-08 15:58:34 -07:00
Sean DuBois
6970c88e2b Add SCTPTransport getter to PeerConnection
This is needed so users can use OnSelectedCandidatePairChange
for DataChannel use cases.

Resolves #713
2020-10-07 08:13:22 -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
tarrencev
a0cc7bda99 Fix: Flakey OnNegotiationNeeded tests 2020-09-27 16:54:04 -07:00
tarrencev
81cfadaf06 Fix: CreateOffer race condition
Fixes a race condition that occurs when the local media (transceivers)
are mutated during the offer generation process.
2020-09-11 14:05:19 -04: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
Sean DuBois
9f1417347a Support creating a DataChannel during renegotation
Before when creating an offer during renegotation we didn't support
adding a DataChannel.

Resolves #1361
2020-08-12 21:43:34 -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
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