Commit Graph

66 Commits

Author SHA1 Message Date
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
Luke
ce8de088e7 Add RTCPFeedback support to PopulateFromSDP
Handles the newly added RTCPFeedback information from pion/sdp
2020-02-05 18:07:59 -05:00
Sean DuBois
a7e3c8623d Prefer Opus over G711
Relates to #991
2020-01-30 14:16:21 -08: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
Bao Nguyen
d265906d6f Fixing panic for VP9
Once [1] is merged, this will allow for VP9 codec
to be loaded but noop which will fix [2] from panic
when attempting to use VP9.

[1] https://github.com/pion/rtp/pull/39
[2] https://github.com/pion/example-webrtc-applications/issues/37
2020-01-20 21:18:39 -08:00
adwpc
da03cb4a4d RTP codec and sdp support transport-cc
RTP codec and sdp support transport-cc
2020-01-08 22:31:56 +08:00
adwpc
bac0c492a9 Sdp support transport-cc
Sdp support transport-cc
2020-01-08 22:31:56 +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
6a29bdf304 Fix typo in MediaEngine
Correctly build PCMU/PCMA entries, before was using NewRTPOpusCodec
2019-10-23 23:44:17 -07:00
Sean DuBois
d1236c8c80 Add G711 Support
Resolves #851
2019-10-10 13:13:25 -07:00
Sean DuBois
0d585106c0 Add examples/play-from-disk
Using IVFReader demonstrate how users can stream a video
from hard disk to browser.

Relates to #636
2019-08-08 16:44:50 -07:00
Mike Coleman
4095d2cde9 Fix for Safari and latest Firefox
This fixes the echo program so it works properly on Safari
and Firefox, where the preferred offered dynamic media type
is not 96/VP8. It loads MediaEngine with codecs found in the
offer and then uses the payload type of the offer's preferred
video codec in the answer.
2019-08-07 11:53:42 -07:00
Sean DuBois
0d768e26f5 Add issue links for MediaEngine TODOs
Relates to #106
2019-07-27 09:35:55 -07:00
Sean DuBois
ad185daaa5 Update TODO for VP9 Payloader
Not supported yet, created a ticket for it

Relates to #106
2019-07-27 09:35:55 -07:00
Sean DuBois
cc940bc5f4 Rename pion-webrtc -> Pion WebRTC
Mass rename everywhere we forgot to update
2019-06-30 21:29:35 -07:00
Sean DuBois
40f5b9459b Update H264 Default Payload type
Short term fix, we need to update examples and show how you should probe
offer when deciding your payload type
2019-04-10 19:50:20 -07:00
Sean DuBois
1cdfc10c84 Mass replace pions -> pion
Pions organization was renamed to pion
2019-04-04 15:32:03 -07:00
Sean DuBois
1202dbaa06 Migrate SDP generation to Unified Plan
This commit has breaking changes. This API change means we
can no longer support an arbitrary number of receivers. For every track
you want to receive you MUST call PeerConnection.AddTransceiver

We do now support sending an multiple audio/video feeds. You can see
this behavior via gstreamer-receive and gstreamer-send currently.

Resolves #54
2019-04-04 12:55:36 -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
Luke Curley
205c759a69 Add feedback support to SDP generation
Syntax could be better but works in a standards-compliant way.

```
codec := webrtc.NewRTPH264Codec(webrtc.DefaultPayloadTypeH264, 90000)
codec.RTPCodecCapability.RTCPFeedback = []webrtc.RTCPFeedback{{
    Type: "nack",
}, {
    Type:      "nack",
    Parameter: "pli",
}}
```
2019-03-20 15:44:17 -07:00
Woodrow Douglass
8a4878c2c4 Don't allow RTP codecs that violate RFC7587
Resolves #462
2019-03-01 16:00:33 -05:00