52 Commits

Author SHA1 Message Date
SangHo
3e2a804b08 Fix MIME type comparisons to be case-insensitive 2025-04-28 05:33:44 +03:00
Nils Ohlmeier
5676fa4d38 Don't expose new MediaEngine functions 2025-04-15 11:54:34 -06:00
Manish
29d6e41b97 Add support for multi codec negotiation 2025-04-15 11:54:34 -06:00
Manish
19789447bb Return error if payload type exists in codecs list 2025-03-01 22:02:48 +02:00
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
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
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
2024-11-13 23:44:00 -05:00
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
Sean DuBois
9c6604df0a Drop calls to RegisterDefaultCodecs in tests
Not needed anymore
2024-07-18 16:14:23 -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
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
Sean DuBois
b549c9580d Enable Simulcast RTP Headers by default
Relates to #2557
2023-09-13 12:38:26 -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
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04: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
Aditya Kumar
dfbbd22c3d Fix case insensitive mimetype check
Relates to pion/webrtc #2241
2022-05-24 21:16:47 -07:00
Adrian Cable
81e80b465f Linty fixes
I have been writing too much Node code recently
2022-05-23 18:15:16 -07:00
Adrian Cable
14c032ce72 Fix TestExtensionIdCollision
This test previously assumed deterministic (i.e. ordered)
behaviour for getRTPParametersByKind which is not necessary, and
is no longer true following PR #2236 due to use of range. The
result was that occasionally this test would fail incorrectly
(thanks, golang-ci). This PR fixes the test.
2022-05-23 18:15:16 -07:00
cnderrauber
89c05b714f Generate unique extmap id for extensions
Generate unique extmap id for extesions with different uri
2022-05-23 17:06:21 -07:00
Adrian Cable
63b4529ca1 Fix conflicting/misassigned extmap IDs on re-offer
This PR addresses an issue whereby under a specific (but not unusual)
circumstance. Pion fails in two different ways to generate the correct
SDP extmap IDs for a track. Some browsers are more picky about this
than others, but Firefox is known to be picky and this issue may be
responsible for some reported incompatibilities.

Sequence to trigger the issue:

* Pion side registers audio & video codecs and audio & video header
  extensions.
* Pion side gets an audio-only offer from the remote, and responds
  with an answer.
* At some later point in time, Pion side wants to add a video track
  and prepares a new offer.
* Extmap IDs in the new offer SDP are usually incorrect
  conflicting/misassigned

Co-authored-by: Hugo Tunius <hugo@lookback.io>
Relates to: webrtc-rs/webrtc#154
2022-05-13 22:18:30 -04: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
juberti
be49dbc5cb Use audio negotiated PTs before video builtin PTs
This avoids a bug where negotiating Opus with PT 96 in an audio-only
session results in the VP8 codec being picked for a track (because
96 is the built-in type for VP8).
2022-01-11 15:17:14 -05: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
cnderrauber
d2f672f343 Fixes MediaEngine: codec apt negotiation
codec has apt fmtp can't negotiation because it's
apt payloadtype can't be found in negotiation codecs.
rtx codec must be partial match if apt codec is partial.

Was reverted in eeb67e1

Fixes #1785
2021-04-24 10:00:49 -07:00
Sean DuBois
fbb9051aee Revert "Fixes MediaEngine: codec apt negotiation"
This reverts commit eeb67e1c53.
2021-04-23 10:54:25 -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
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
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
adwpc
7069c5dc05 Fix register the same codec
Otherwise addTransceiverSDP will add duplicate codec sdp
2021-02-16 15:12:34 -08:00
Sean DuBois
24f350c926 Safari's codec matching requires video be upcased
Upcase H264, VP8 and VP9. Otherwise Safari doesn't recognize those
codecs.

Resolves pion/example-webrtc-applications#89
2021-02-11 14:05:04 -08:00
Sean DuBois
b5fa979c08 Don't enable RID/MID Extension Headers by default
Chrome is failing to signaling if the remote peer offers RID/MID so
disabling by default.

Relates to pion/example-webrtc-applications#87
2021-02-09 14:01:10 -08:00
tarrencev
5ee9a316a9 Export mime types
Export mime types from media enginer for matching
2020-12-06 00:58:06 -05:00
Sean DuBois
3d9a7ede1a Allow extensions to be configured with direction
RegisterHeaderExtension now allows users to enable headers depending on
the type of transceiver that was created.

Also expose GetParameters on RTPSender and RTPReceiver

Co-authored-by: OrlandoCo <luisorlando.co@gmail.com>

Resolves #1554
2020-12-04 11:52:48 -08:00
Adam Kiss
5bbc84e404 Implement Interceptors
Provide API so that handling around RTP can be easily defined by the
user. See the design doc here[0]

[0] https://github.com/pion/webrtc-v3-design/issues/34
2020-11-26 11:23:19 -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
rahulnakre
4c1440c04c Make getCodecSDP case insensitive
EqualFold to compare codec names in a case
insensitive manner

Fixes #1442
2020-10-06 19:23:18 -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
Roman Romanenko
13adbb503e Tests
added simple test cases;
2020-06-18 11:46:32 -07:00
Sean DuBois
846257b1a1 Don't upcase opus when adding to SDP
When making MediaEngine case-insensitive in 20f2d18
Opus was upcased when adding to SDP. This returns it
to what it was before

Resolves #1078
2020-03-14 00:03:55 -07:00
Sean DuBois
f1fbbe7af8 Revert PopulateFromSDP RTCPFeedback support
This causes users who use PopulateFromSDP to declare
they support transport-cc.  Since they don't send receiver
reports. They will get a degraded experience unexpectedly.

Partially revert ce8de088e7.

Resolves #1026
2020-02-13 20:22:19 -08:00
Luke
ce8de088e7 Add RTCPFeedback support to PopulateFromSDP
Handles the newly added RTCPFeedback information from pion/sdp
2020-02-05 18:07:59 -05:00
Luke S
20f2d1899e Case-insensitive media subtype check
Updates mediaengine according to [1] and [2].

[1] https://tools.ietf.org/html/rfc4855#section-3
[2] https://tools.ietf.org/html/rfc4288#section-4.2
2020-01-21 13:07:39 -08:00
Atsushi Watanabe
27d9bbb7bd Upgrade golangci-lint to 1.19.1
Fix whitespace and stylecheck errors.
Disable godox.
2020-01-11 22:59:33 -08:00
Sean DuBois
7f53f4b7a8 Fix PopulateFromSDP with Application MediaSection
PopulateFromSDP did not properly handle Offers with Datachannels, now
we only parse a MediaSection that has a name of 'audio' or 'video'

Resolves #953
2019-12-20 01:17:21 -08:00
Sean DuBois
d1236c8c80 Add G711 Support
Resolves #851
2019-10-10 13:13:25 -07:00
Hugo Arregui
6997cc792c Linter fixes
Disable funlen and some fixes

Co-authored-by: Sean DuBois <sean@siobud.com>
2019-09-10 21:48:25 -07:00
Sean DuBois
1cdfc10c84 Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 15:32:03 -07:00
Alex Browne
012a7ea686 Improve build tags for Wasm
Fixes #515

This includes a few small and closely related changes:

1. All occurrences of the build tag `+build js` have been changed to the
   more precise `+build js,wasm`. This will exclude the files from being
   included by third-party compilers like GopherJS, with which they are
   incompatible.
2. Some files which are incompatible with JavaScript/Wasm now have the
   correct build tag (`+build -js`) so they will be excluded from Wasm
   builds.
3. Some configuration options which are incompatible with
   JavaScript/Wasm (or at least the current bindings) will now no longer
   appear in Wasm builds. This meant creating new files with new struct
   definitions and the appropriate build tags.
2019-03-22 10:48:03 -07:00
Max Hawkins
9cba54cfd0 Upgrade to pions/sdp v2
Relates to #417
2019-02-18 11:47:05 -08:00