Commit Graph

86 Commits

Author SHA1 Message Date
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
836184c2c1 Update module github.com/pion/rtp to v1.8.4 2024-03-18 14:18:17 -04: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
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
dc4b591c4d Start pion/webrtc/v4
60eea43 is a breaking change
2023-09-05 11:48:14 -04:00
Evan Sonderegger
f0a5355149 Update RegisterDefaultCodecs to match libwebrtc
VP9 has been moved below AV1. Some missing H264 profiles have been added
2023-08-05 15:30:01 -04:00
Sean DuBois
90e3a83b57 Add support to AV1 in play-from-disk
Resolves pion/rtp#190
Resolves pion/rtp#191
2023-07-20 19:42:44 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
Sean DuBois
bea005909c Improve MediaEngine docs
By default they aren't copied
2023-04-25 13:15:31 -04: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
Daniele Sluijters
b8fd4d98ea Fix incorrect conversion between integer types
The result of strconv.Atoi uses an architecture dependent bit size. It
is not safe to use when converted to an integer type of a smaller size,
without performing bounds checking.

Instead, use Parse(U)int with the desired base and size. Though this
returns a (u)int64, it can then be safely converted into a (u)int8 etc.
2022-05-09 13:07:42 -04:00
Sean DuBois
315bbfa723 Add AV1 Support
Also include example

Resolves #1670
2022-04-12 10:20:00 -04: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
Kevin Wang
7004fbb766 Add H265 and AV1 MimeTypes
This change adds constants for H265 and AV1. Neither are fully
supported in pion, however these constants are still useful and we will
likely send a change to add H265 and AV1 packetizer/depacketizers in
the future.
2022-01-12 11:09:02 -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
David Zhao
5f6baf7325 Fixed locking order in SRTP and DataChannel
Two separate potential deadlocks

1. typically the locking order is SRTP first, then DataChannel.
   However, when data channel is opened, it's locking srtp when
   generating an ID.
   It also would return without unlocking when an error is encountered
2. recursive RLock could be potentially problematic. MediaEngine
   contained a section doing so.
2021-11-11 13:06:19 -08:00
Sean DuBois
cffa6afc34 Rollback pion/rtp to v0
Resolves #1908
2021-08-02 18:05:45 -04:00
Ryan Shumate
2d529be571 Improved h264 fmtp line parsing
Implements h264 fmtp parsing based on RFC 6184 Section 8.2.2
2021-07-30 13:23:07 -04:00
Atsushi Watanabe
d544be17d9 Enable VP8 PictureID by default
For using in SLI.
2021-07-29 12:22:36 -04:00
Sean DuBois
a67c66a0c5 Upgrade pion/rtp to v2
Also updates interceptor and srtp
2021-07-29 11:18:41 -04:00
digitalix
f524fea32a Implement SetCodecPreferences in RTPTransceiver
This allows to set supported codecs per transceiver.

Resolves #1847
2021-06-28 10:54:31 -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
Atsushi Watanabe
07d7403cca Parse and compare FmtpLine on codec select
Exact match if fmtp parameters are not inconsistent.

e.g. default OPUS fmtp of the browsers are:
  Chrome:  minptime=10;useinbandfec=1
  Firefox: maxplaybackrate=48000;stereo=1;useinbandfec=1
They should be treated as matched.
2021-03-21 13:41:33 +09: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
c8b7aa386a Disable MediaEngine Copy by Default
If an API is shared between PeerConnections they would use the same
MediaEngine. A MediaEngine contains negotiated PayloadTypes so if the
PeerConnections were answering you would end up in invalid states.

Add DisableMediaEngineCopy to SettingEngine in case user needs old
behavior.

Resolves #1662
2021-02-09 21:31:57 -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
a54b74cdb7 Update pion/interceptor for NACKs
Generate + Respond interceptors
2020-12-14 21:40:09 -08:00
pascal-ace
85ced4ad69 Update payloaderForCodec to be case insensitive
Remove sharp edge when creating sample track
2020-12-14 10:19:05 -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
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
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
804a12fed3 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-30 09:06:34 -07:00
obasajujoshua31
7d79c766c9 Add GetMediaStats to StatsReport
Add an API to get basic stats around media.

Relates to #610

mend
2020-09-22 14:05:06 -04: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
bc742b2f88 GetCodecsByName method;
added method for get codecs by name;
2020-06-18 11:46:32 -07:00
Juliusz Chroboczek
1e68320bab Implement NewRTPVP9CodecExt
This was omitted for some reason.
2020-06-10 13:46:58 -07:00
Josh Bleecher Snyder
455e955636 Document that some MediaEngines may be re-used
And while we're here, improve a bunch of related documentation
and comments.
2020-06-06 13:28:32 -07:00
adwpc
862d30743e Support new codec with fmtp
This enable people set ios needed fmtp to sdp
2020-03-29 12:39:49 -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
Hendrik Hofstadt
65a7632179 Allow formatting parameters for all codecs
Formatting parameters are not only allowed on video
codecs but also on most audio codecs. Without this change,
custom parameters of audio codecs would be dropped when
parsing SDPs (e.g. opus parameters)
2020-02-14 11:09:56 -08: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