2264 Commits

Author SHA1 Message Date
Pablo Fuente Pérez
fe41afd3f2 Fix deadlock in DataChannel with mutex unlock
Fulfill request changes in PR 3009

Close answer and assert errors in detach tests
2025-01-16 13:11:57 +01:00
renovate[bot]
49b555bbc1 Update module github.com/pion/ice/v4 to v4.0.4 (#3004)
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/pion/ice/v4](https://redirect.github.com/pion/ice) |
`v4.0.3` -> `v4.0.4` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fpion%2fice%2fv4/v4.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fpion%2fice%2fv4/v4.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fpion%2fice%2fv4/v4.0.3/v4.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fpion%2fice%2fv4/v4.0.3/v4.0.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>pion/ice (github.com/pion/ice/v4)</summary>

### [`v4.0.4`](https://redirect.github.com/pion/ice/releases/tag/v4.0.4)

[Compare
Source](https://redirect.github.com/pion/ice/compare/v4.0.3...v4.0.4)

#### What's Changed

- docs(agent_config.go): update KeepaliveInterval default value to 2 sec
by [@&#8203;amincheloh](https://redirect.github.com/amincheloh) in
[https://github.com/pion/ice/pull/730](https://redirect.github.com/pion/ice/pull/730)
- Add nil checks to agent_handlers by
[@&#8203;dkess](https://redirect.github.com/dkess) in
[https://github.com/pion/ice/pull/751](https://redirect.github.com/pion/ice/pull/751)
- Use addrEqual for candidate comparison by
[@&#8203;paulwe](https://redirect.github.com/paulwe) in
[https://github.com/pion/ice/pull/752](https://redirect.github.com/pion/ice/pull/752)

#### New Contributors

- [@&#8203;amincheloh](https://redirect.github.com/amincheloh) made
their first contribution in
[https://github.com/pion/ice/pull/730](https://redirect.github.com/pion/ice/pull/730)

**Full Changelog**: https://github.com/pion/ice/compare/v4.0.3...v4.0.4

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/pion/webrtc).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-14 08:17:48 +00:00
Juliusz Chroboczek
f2191fbfa7 Finish moving SDESRTPStreamIDURI (#3000)
Finish moving SDESRTPStreamIDURI from here to pion/sdp.
2025-01-13 09:25:13 -05:00
Xavier Drudis
cdacd1c3b0 Rewrite VP8 isKeyFrame check (#2999)
#### Description
[RFC 6386](https://www.rfc-editor.org/rfc/rfc6386#section-9.1) describes
the least significant bit of the first byte of the header as:
```
A 1-bit frame type (0 for key frames, 1 for interframes).
```

The change is functionally a no-op, but the naming implies the wrong
logic (you would assume `isKeyFrame == 1` means it is a key frame, but
the opposite is true).

#### Reference issue
Fixes #...
2025-01-11 21:32:28 -08:00
Joe Turk
5edce958fd Include sdpMid and sdpMLineIndex for ICECandidates returned by OneICECandidate (#2990)
#### Description
Currently, Pion returns an empty `sdpMid` and a 0 `sdpMLineIndex`. This
PR ensures Pion returns the corresponding `sdpMid` and `sdpMLineIndex`
for ICE candidates for clients that expects it. Fixes trickle issues.

#### Changes

1. `ICECandidates`: New fields `SDPMid` and `SDPMLineIndex`.
2. `ICEGatherer`: `SetMediaStreamIdentification` and return the correct
`SDPMid` and `SDPMLineIndex`.
3. `extractICEDetails`: Return a struct instead of multiple values.
4. `extractICEDetails` refactored the media description selection to a
different function.
5. Added new tests.

#### Reference issue
Fixes https://github.com/pion/webrtc/issues/2690
Fixes https://github.com/pion/webrtc/issues/1833
2025-01-08 19:08:44 -06:00
Juliusz Chroboczek
c50ca41e56 Improve documentation of ConfigureTWCCSender
Mention that it must be called after registering codecs.
2025-01-08 10:00:37 -05:00
Juliusz Chroboczek
6f6231b062 Minor fixes to TestInterceptorNack
One variable was misnamed, and we never checked for the end
of the RTCP loop.
2025-01-08 10:00:12 -05:00
5ur3
b47fbb6b5e Implement more webrtc-stats
InboundRTPStreamStats:

* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-pausecount
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-totalpausesduration
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-freezecount
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-totalfreezesduration
* https://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-powerefficientdecoder

OutboundRTPStreamStats:
* https://www.w3.org/TR/webrtc-stats/#dom-rtcoutboundrtpstreamstats-powerefficientencoder
* https://www.w3.org/TR/webrtc-stats/#dom-rtcoutboundrtpstreamstats-scalabilitymode
2025-01-08 09:59:30 -05:00
Joe Turk
c895252d72 Gracefully close connecting channels (#2991)
Fixes an issue where calling dataChannel.Close on
'connecting' state channels didn't work as expected.
When handling the `OnOpen` event detect if the
user has requested close.

Fixes #2659
2025-01-08 09:57:55 -05:00
Xavier Drudis
1ee02999eb Defense against timebase with denominator 0 2025-01-02 15:33:18 -05:00
Xavier Drudis
40358b3d1e Defense against timebase with denominator 0 2025-01-02 15:33:18 -05:00
Xavier Drudis
d5e07a1bcf Restore relative timestamp 2025-01-02 15:33:18 -05:00
Xavier Drudis
04b46212a9 Nits 2025-01-02 15:33:18 -05:00
Xavier Drudis
31d8dbc720 Fix IVF timestamps 2025-01-02 15:33:18 -05:00
Xavier Drudis
8b3734e5d3 Revert "Adapt an existing test to provide coverage"
This reverts commit dbe26d34d8.
2025-01-02 15:33:18 -05:00
Xavier Drudis
0ae39fd72a Revert "IVF writer fix invalid timestamp into headers"
This reverts commit 4f40756d9c.
2025-01-02 15:33:18 -05:00
Juliusz Chroboczek
92fce5ff17 Add an end-to-end test for the NACK sender
Test that NACKs are negotiated correctly, and that we receive
the expected NACK if we negotiated it.
2025-01-02 15:37:53 +01:00
Xavier Drudis
92d573c35b Fix broken links in save-to-disk examples 2025-01-01 23:32:10 -05:00
renovate[bot]
384646e7d6 Update module golang.org/x/net to v0.33.0
Generated by renovateBot
2025-01-01 03:31:06 +00:00
Yang Hau
dca5d743cf Fix bandwidth-estimation-from-disk timestamping
Set the frameHeader when reading the file so the currentTimestamp
actually gets set
2024-12-26 23:36:56 -05:00
Aleksandr Alekseev
80b5649f43 Add Encoder/Decoder info to stats 2024-12-26 23:34:44 -05:00
Aleksandr Alekseev
3f246fdad2 Close interceptor after PeerConnection is closed v4.0.7 2024-12-24 23:12:04 +03:00
sukun
b82306ab62 Fix detached datachannels handling
https://github.com/pion/webrtc/pull/2696 introduced removing
datachannels from the sctptransport for better garbage collection.

That PR introduced a race condition for data channels created before
connection establishment. When an out of band negotiated data channel,
created before peerconnection establishment is detached, there's a race
between the data channel being removed from `r.dataChannels` and it
being copied in to the existing data channel slice in the
acceptDataChannels goroutine.

This PR fixes this race by copying the slice before any datachannels
could be detached.
2024-12-24 17:00:21 +00:00
renovate[bot]
fbf79c12f0 Update module github.com/pion/rtp to v1.8.10
Generated by renovateBot
2024-12-17 11:51:04 -05:00
cnderrauber
9cfda8be16 Add EnableDataChannelBlockWrite to SettingEngine
The settingengine can enabled block write if
datachannel is detached, makes it working like
a normal net.Conn.
v4.0.6
2024-12-16 12:18:56 +08:00
renovate[bot]
6a3f35505c Update module github.com/pion/rtcp to v1.2.15
Generated by renovateBot
2024-12-16 03:31:28 +00:00
boks1971
9eee2cc038 Remove stopped member from RTPTransceiver
It is unused. If needed in the future we can add it back
2024-12-14 20:07:11 -05:00
Juliusz Chroboczek
2585a2fd03 Improve the documentation of NewPeerConnection 2024-12-14 19:43:44 -05:00
Sean DuBois
cbe660b713 Use intersection of codecs to generate rtcp-fb
Update MediaEngine codec creation to take into account remote
and local rtcp-fb. Before we would incorrectly always take
the remote rtcp-fb and ignore local.

Resolves #2943
Resolves #2944
Resolves #1968
2024-12-14 19:32:20 -05:00
WofWca
1c4bc798fe Improve DataChannel.Detach() docstring
It wasn't clear (at least to me)
what "idiomatic API" it's referring to.

But, judging from the `data-channels-detach` example comments,
this is what it's made for.
f29ef99b22/examples/data-channels-detach/main.go (L4)
2024-12-13 07:31:40 -05:00
renovate[bot]
233526d671 Update module github.com/pion/datachannel to v1.5.10
Generated by renovateBot
2024-12-10 08:06:22 +00:00
cnderrauber
8e2c8682de Add option to disable close by dtls
Close peerconnection on DTLS.CloseNotify
could break ice restart with dtls restart,
when the dtls finger-print changed, the
browser could teardown the old dtlstransport
and establish new one then pion could close
the peerconnection and restart failed. So
browser don't do this and spec also don't
say peerconnection should close when dtls
is closed.
v4.0.5
2024-11-29 08:09:21 -05:00
cnderrauber
2553783e53 Fix nil rtcpInterceptor on track.Bind
Create rtcpInterceptor before bind called.
v4.0.4
2024-11-28 18:28:12 +08:00
Sean DuBois
f8294e0ee6 Update module github.com/pion/ice/v4 to v4.0.3 v4.0.3 2024-11-26 10:50:30 -05:00
WofWca
345d574c36 Update SettingEngine to use named return values
The behavior of SetInterfaceFilter and SetIPFilter isn't obvious. Name
the bool so the user understands the behavior from the function
definition.
2024-11-25 23:25:52 -05:00
renovate[bot]
7c76e0907b Update module github.com/stretchr/testify to v1.10.0
Generated by renovateBot
2024-11-23 15:31:27 +00:00
renovate[bot]
141144f1c3 Update module github.com/pion/sctp to v1.8.34
Generated by renovateBot
2024-11-20 15:41:47 +00:00
Nils Ohlmeier
2fd3640fa3 Only collect single fingerprints/ICE credentials
The way currently DTLS fingerprints and ICE credentials
are picked is causing interop issues as described in #2621

Peers which don't use Bundle can use different fingerprints
and credentials in each media section. Even though is
not (yet) supported by Pion, receiving an SDP offer from
such a peer is valid.

Additionally if Bundle is being used the group attribute
determines which media section is the master bundle section,
which establishes the transport. Currently Pion always
just uses the first credentials/fingerprint it can find
in the SDP, which results in not spec compliant behavior.

This PR attempts to fix the above issues and make
Pion more spec compliant and interoperable.

Fixes #2621
v4.0.2
2024-11-13 23:44:00 -05:00
renovate[bot]
363e017709 Update module github.com/pion/dtls/v3 to v3.0.4
Generated by renovateBot
2024-11-05 00:38:15 +00:00
renovate[bot]
8c06e02690 Update module golang.org/x/net to v0.30.0
Generated by renovateBot
2024-11-01 04:46:34 +00:00
Sean DuBois
e53cbc423a Fix race when closing ICE Transport
Struct member is copied to stack already, `stop` just incorrectly was
referencing the member.

Found in CI
2024-10-27 23:35:56 -04:00
Sean DuBois
ae89317088 Test that NULL Protection Profile is disabled
Resolves pion/srtp#297
2024-10-27 23:13:43 -04:00
lt
271ab556c8 Add WithPayloader to TrackLocalStatic
Allow custom payloader depending on the mime type

Fixes #2928
2024-10-15 12:12:13 -04:00
Eric Daniels
76634b143a Add SetFireOnTrackBeforeFirstRTP v4.0.1 2024-10-15 12:10:07 -04:00
Brave Yao
8fbf8219dd Change receiveMTU from 1460 -> 1500
Raise the default ReceiveMTU to 1500, as same
as the default MTU setting of WebRTC. This is because
some senders, i.e. FFmpeg, may packetize RTP with 1460
payload + 12 RTP header + etc.

Fixes #2927
2024-10-14 23:42:13 -04:00
Sean DuBois
e51984e811 Add siobud.com/meeting to README 2024-10-14 12:15:57 -04:00
Sean DuBois
3f1622a2f4 Add v4 Release Notes to README v4.0.0 2024-10-11 00:00:36 -04:00
Sean DuBois
bb41f23a0f Don't use JitterBuffer in SampleBuilder
The performance of the SampleBuilder is significantly worse when using
the SampleBuilder. It would be good to evaluate improving the
performance of the JitterBuffer. However for the time being we are just
going to revert.

Resolve #2778
2024-10-10 21:18:56 -04:00
boks1971
dc1f8ffd1c Add ice transport api to get selected pair stats
In use cases like SFU, it is useful to get just the selected candidate
pair stats to have access to current RTT on the peer connection. The
standard has a way to do `GetSelectedCandidatePair` on `ICETransport`,
but does not have a way to get stats of that pair.

Although not in standard, adding a method to `ICETransport` to get
selected candidate pair along similar lines of above method.
2024-10-07 21:00:33 +05:30
Sean DuBois
64f32d2215 Add missing a=ssrc lines for RTX/FEC
Pion extracts them from ssrc-group line so this didn't failed
Pion<->Pion. Chrome/FireFox uses the dedicated a=ssrc lines and our
Offer/Answer would break negotation

Fixes #2922
v4.0.0-beta.34
2024-10-07 11:22:42 -04:00