Commit Graph

301 Commits

Author SHA1 Message Date
Sean DuBois
4541b73b1a Add Retransmission and FEC to TrackLocal
If the MediaEngine contains support for them a SSRC will be generated
appropriately

Co-authored-by: aggresss <aggresss@163.com>
Co-authored-by: Kevin Wang <kevmo314@gmail.com>

Resolves #1989
Resolves #1675
2024-10-03 20:44:49 -07: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
Eric Daniels
9a61d68237 Fix concurrent pc.GracefulClose 2024-08-26 10:50:45 -04:00
Eric Daniels
48a2e5a0cc Revert "Run ops.GracefulClose earlier in pc.Close"
This reverts commit ec6b6f1d54.
2024-08-14 14:36:04 -04:00
Eric Daniels
ec6b6f1d54 Run ops.GracefulClose earlier in pc.Close 2024-08-13 09:29:11 -04:00
Sean DuBois
3aab0355e0 Upgrade dtls, ice, stun and turn
New major version of all packages caused by DTLS upgrade
2024-08-12 13:45:35 -04:00
Eric Daniels
78c8a2e07c Add PeerConnection.GracefulClose 2024-08-06 09:51:54 -04:00
Juan Navarro
cbbb1c29e5 Fix disordered RIDs in SDP
Map iteration order is not guaranteed by Go, so it's an error to iterate
over a map in places where maintaining the same ordering is important.

This change replaces the map of simulcastRid{} with an array of the same
type. The simulcastRid{} type is extended to hold the rid-id which
previously was used as the key in the map.

Accesses to the map are replaced with range loops to find the desired
rid-id for each case.

Fixes #2838
2024-08-01 10:56:45 -04:00
Eric Daniels
05cafb3d03 Close unhandled rtcp simulcast streams
handleIncomingSSRC will call streamsForSSRC which
opens rtp/rtcp streams that if unhandled can be
leaked resources. Now we will proactively open
them before calling handleIncomingSSRC and close
then later. In the future it would be better to
do this inside handleIncomingSSRC to protect other
callers.
2024-07-23 00:03:17 -04: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
Eric Daniels
17d3e97b59 Hold pc.mu while populating local candidates 2024-07-19 12:05:41 -04:00
cnderrauber
287d10638d Match header extensions to remote media sections
Firefox would send updated header extension
in renegotiation, e.g. publish a track without
simucalst then renegotiate second track with
simucalst, the two media secontions will have
different rtp header extensions in offer. Need
to match remote header extentions for each
media sections to avoid second track publish
failed.
2024-07-18 12:30:19 +08:00
Sean DuBois
e17ce04589 Revert 7c8bfbd44a and add test
Don't block Close on spawned goroutines
2024-07-15 11:26:21 -04:00
Eric Daniels
7c8bfbd44a Make pc.Close wait on spawned goroutines to close 2024-07-01 20:54:27 -04:00
Eric Daniels
1bb9fa9020 Make onNegotiationNeeded conform to spec
- Removes non-canon logic
2024-06-24 11:03:40 -04:00
Eric Daniels
ca05618c7f Reset state machine after negotiationNeededOp
- Fixes #2774
2024-06-11 13:49:06 -04:00
knowmost
a97c420d0c Fix typos in multiple comments 2024-04-27 23:27:55 -04:00
Sean DuBois
92df4bf0ec Include msid-semantic in Session Attributes
Chrome doesn't include the msid when responding to
recvonly transceivers

See crbug[0] for discussion

[0] https://issues.chromium.org/u/1/issues/328522463
2024-04-01 13:25:22 -04:00
sukun
835ac3b08e Drop reference to detached datachannels
This allows users of detached datachannels to garbage collect
resources associated with the datachannel and the sctp stream.
There is no functional change here.
2024-03-24 22:21:35 -04:00
Andrei Nistor
313ca8c314 Refactor NewPeerConnection
Skip registering the default codecs and interceptors in
NewPeerConnection.
The NewAPI() function already registers them by default  (since #2630)
2024-03-18 09:45:45 -04:00
Sean DuBois
6190b2df6c Update module github.com/pion/sdp to v3.0.8 2024-03-06 22:25:19 -05:00
cnderrauber
2407bf2ed2 Refine rtx support
Always handle header extensions from packet read
from interceptor, let interceptor has consistent
chance to process headers

Fix rtx is not negotiated when there is multiple
codecs has same mime but different profile (H264)

Fix rtx stream info missed when SSRC group attr
shows after base track's ssrc attr.
2024-02-05 22:48:24 +08:00
cnderrauber
dae5e8e1a0 Skip padding packet for simulcast probe
Skip padding packet for simulcast probe
Fix rtx attributes panic for nil map
2024-02-01 22:57:05 -08:00
Mikhail
759fc73984 Respect SSRC Choice by User
Respect SSRC chosen via RTPTransceiverInit
2023-09-14 14:08:38 -04:00
Sean DuBois
b549c9580d Enable Simulcast RTP Headers by default
Relates to #2557
2023-09-13 12:38:26 -04:00
Woodrow Douglass
13450332a4 Remove the "Unknown" constant
This commit replaces the Unknown constant with
separate constants for each enumeration that
uses it.

Fixes #1293
2023-09-12 13:29:05 -04:00
Sean DuBois
5cf4168432 Fix OnICEGatheringStateChange Signature
Return ICEGatheringState not ICEGathererState

Relates to #2557
2023-09-11 14:32:23 -04:00
Aleksandr Alekseev
e507d46e1c Improve checkNegotiationNeeded replaceTrack
replaceTrack with nil would cause a crash
2023-09-08 14:08:02 -04:00
cnderrauber
2225386c41 Generate answer to match group bundle in offer
Generate answer to match group bundle in offer
2023-09-08 09:30:52 -07:00
Sean DuBois
dc4b591c4d Start pion/webrtc/v4
60eea43 is a breaking change
2023-09-05 11:48:14 -04:00
Sean DuBois
60eea430ac Close PeerConnection on DTLS CloseNotify
Resolves #1767
Resolves pion/dtls#151
2023-09-05 04:52:17 -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
zhngs
20f83933c3 Fix incorrect ice-lite comment
The lite agent is controlled, not controlling.
2023-09-03 14:09:14 -04:00
Hao
1390b16097 Fix typo 'Renegotation' across project
'Renegotation' -> 'Renegotiation'
2023-08-24 14:14:29 -04:00
Kunal Singh
1df634e118 Remove golint from godoc and move no next line 2023-05-22 15:20:59 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
Jerry Tao
16fea9ee04 Set DataChannel SCTPTransport before OnDataChannel
ORTC API would return a nil SCTPTransport for DataChannels returned via
Callback
2023-04-24 00:51:50 -04:00
streamer45
d08b3dc403 Handle Simulcast Offer with one Media Section
Everytime we receieve a new SSRC we probe it and try to determine the
proper way to handle it. In most cases a Track explicitly declares a
SSRC and a OnTrack is fired. In two cases we don't know the SSRC
ahead of time
* Undeclared SSRC in a single media section (pion/webrtc#880)
* Simulcast

The Undeclared SSRC processing code would run before Simulcast.
If a Simulcast Offer/Answer only contained one Media Section we
would never fire the OnTrack. We would assume it was a failed
Undeclared SSRC processing. This commit fixes the behavior.
2023-04-23 00:04:54 -04:00
cnderrauber
6114c278c1 Fix simucalst track set to incorrect detail
When there are more than one simucalst media lines in sdp,
we need check mid when parse detail for simulcast track.
2023-04-14 08:56:55 -07:00
Pion
308f8616a3 Update CI configs to v0.10.6
Update lint scripts and CI configs.
2023-04-08 14:24:19 -04:00
Eric Daniels
777e03ca3c Fix negotiation needed panic on nil Sendonly track
In step 5.3.1, since we do not have a sender we can only choose
to signal that we need negotiation.
2023-03-07 22:59:45 -08: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
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
fa6be2c31d Fix lint error
Fix lint error
2022-11-15 17:12:22 +08:00
cnderrauber
9713221231 Close unhandled stream when peerconnection closed
When PeerConnection closed, need call unhandled stream's
close method to release buffer created by BufferFactory,
otherwise might cause resource leak if user
provide BufferFactory need close to release the resource.
2022-11-15 17:12:22 +08: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
Sean DuBois
7367daf232 Increase requirements for Plan-B detection
Before a SessionDescription was assumed to be Plan-B if it contained a
MediaName of `audio` or `video`. This PR Changes that behavior.

If SDPSemantics is UnifiedPlan the SessionDescription must contain a
MediaDescription with two SSRCes to be considered a Plan-B. Before if
the MediaDescription had name of `audio` or `video` it was assumed to be
Plan-B.

If SDPSemantics is PlanB or UnifiedPlanWithFallback it maintains the
existing behavior.

Resolves #2193
2022-05-23 10:13:02 -04:00