Commit Graph

57 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
Sean DuBois
fda6c4f836 Fix linter errors
golangci-lint upgrade to v1.56.2 added more checks

Relates to pion/.goassets#201
2024-03-16 21:09:38 -04:00
aggresss
dbf22543fe Fix interceptor.RTCPReaderFunc typo 2024-02-10 21:16:12 -05:00
Benjamin Pracht
eed2bb2d3b ReplaceTrack resets all track encodings
This PR addresses an issue where calling RTPSender.ReplaceTrack with
a nil parameter on a sender with more than 1 encoding (simulcast) would
only cause the 1st encoding to be unbound, breaking common publisher
reconnection workflows with simulcast enabled.
2023-11-15 18:55: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
dc4b591c4d Start pion/webrtc/v4
60eea43 is a breaking change
2023-09-05 11:48:14 -04:00
Kevin Wang
667d0ff6dc Make TrackLocalContext an interface
This allows external users to provide their own TrackLocalContext to be
bound to a track.
2023-08-03 14:12:08 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
boks1971
37e16a3b15 Bolting on send side simulcast
Introduces AddEncoding method in RTP sender to add simulcast encodings.

Added UTs for AddEncoding.
Also modified the Simulcast send test to use the new API.
2022-02-24 23:55:17 -08:00
Kevin Wang
f644649329 Add ability to set RTP stream ID on TrackLocal
This change makes it possible to set the RTP stream ID to
allow forwarding and production of simulcast streams.
2022-01-14 12:37:06 -05:00
Len
d4b645635c Fix RTPSender.Send crash
If PeerConnection removes track while RTPSender is
created and being negotiated, RTPSender.Send would
access nil pointer. Check If track is nil.

Relates to #2065
2022-01-07 10:46:18 -05:00
Sean DuBois
26ce88e87a Fix RTPSender.GetParameters crash
If a RTPSender doesn't have a track currently set and GetParameters is
called we would call a method on a nil pointer. Now instead of checking
the Track kind we store the kind in the RTPSender.

Resolves #2065
2021-12-26 22:50:52 -05:00
Sean DuBois
11b8873da2 Handle Simulcast RepairStream
Read + Discard packets from the Simulcast repair stream. When a
Simulcast stream is enabled the remote will send packets via the repair
stream for probing. We can't ignore these packets anymore because it
will cause gaps in the feedback reports

Resolves #1957
2021-09-15 15:08:22 -04:00
bkim
3a6aea1d2d Add MTU Configuration to SettingEngine
This gives an option to raise the receive MTU as SettingEngine option.
If SettingEngine has not been set the MTU, then default value is used
instead, 1460

Resolves #1925
2021-08-20 09:59:56 -04:00
OrlandoCo
5253475ec7 Check for nil transceivers on get parameters
For ORTC API senders does not have a transceiver causing
panics on getting parameters.
2021-08-07 22:06:10 -04:00
Sean DuBois
cffa6afc34 Rollback pion/rtp to v0
Resolves #1908
2021-08-02 18:05:45 -04:00
Sean DuBois
a67c66a0c5 Upgrade pion/rtp to v2
Also updates interceptor and srtp
2021-07-29 11:18:41 -04:00
Patryk Rogalski
3af80189da Fixes ReplaceTrack
When ReplaceTrack was set previously to nil
it would be impossible to ReplaceTrack again
with a non-nil value as r.track was set to nil.
2021-07-20 12:41:22 -04:00
aggresss
7b7183eb5a Fix RTPSender's streamInfo miss headerExtensions
Fix transceiver.Sender().Send() not contain HeaderExtensions.
2021-07-01 10:14:06 -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
digitalix
f8a8c09949 Support PayloadTypes changing a TrackRemote
If the PayloadType changes for a SSRC update the codec on the
TrackRemote.

Resolves #1850
2021-06-27 14:44:02 -04:00
Atsushi Watanabe
7e952c73b5 Unbind interceptors on stop
Make resources used by interceptor bindings freed.
2021-03-21 09:03:37 +09:00
mission-liao
40eb352909 Add SetReadDeadline to RTPSender
ReadDeadline is supported by RTPReceiver but not RTPSender. This
commit attempts to provide similar method for RTPSender.

If SetReadDeadine is called with:
- an empty time.Time: it will clear all previous set deadline.
- a non-empty time.Time: it will abort all pending "ReadRTCP" calls if
  the specified time is up.
2021-02-04 10:16:44 +08:00
Sean DuBois
67826b1914 Update Interceptors to use []byte based API
Also update test to assert Attributes get passed all the way through

Resolves pion/interceptor#14
2020-12-13 18:40:33 -08:00
Juliusz Chroboczek
0dea1f91e0 Fix RTPSendParameters
RTPSendParameters contains an array of encodings.
RTPSender.GetParameters returns RTPSendParameters.
2020-12-05 23:02:27 -08: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
Sean DuBois
9715626a0c Revert "Read/Write RTP/RTCP packets with context"
This change caused a ~24% performance decrease

Relates to pion/webrtc#1564

This reverts commit 47a7a64898.
2020-12-02 20:11:06 -08:00
Atsushi Watanabe
47a7a64898 Read/Write RTP/RTCP packets with context
Control cancel/timeout by context.
2020-12-01 11:08:48 +09:00
Sean DuBois
e32d766199 Improve TrackLocal error handling
* Return error to user when remote doesn't support codecs
* Assert that bindings are properly incremented/decremented
* Assert that a added track doesn't error even when disconnected

Relates to #1526
2020-11-27 23:07:29 -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
a218b857bd Implement RTPSender.ReplaceTrack
Resolves #1020
2020-11-18 21:50:27 -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
Sean DuBois
804a12fed3 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-30 09:06:34 -07:00
Sean DuBois
69883c5d5a Fix renegotation race
checkNegotiationNeeded accessed RtpSender field with taking lock

Resolves #1384
2020-09-07 22:52:44 -07:00
Josh Bleecher Snyder
e42bb3e27a Use exported errors for stopped rtp i/o
This makes checking for these errors much more robust
than doing a string comparison.
2020-05-31 11:17:52 -07:00
cnderrauber
667941621d RtpSender/Receiver.Read return err when stopped
Rtpsender.Read & RtpReceiver.Read may block infinite when
it's stopped before Send/Receive has been called.
2020-05-28 20:24:19 -07:00
Simone Gotti
15638d89de Start only negotiated senders
Only start senders that were negotiated.

Since `startTransports`/`startRenegotiation` start rtp senders in a
goroutine, an user could call AddTrack/Add*Transceiver/RemoveTrack
causing a not negotiated sender track ssrc to be started.
2020-05-06 17:57:47 +02:00
Cedric Fung
abe3ea1ea8 Make RTPSender.SendRTP Public
You should use Track instead to send packets. This is
exposed because pion/webrtc currently provides no way
for users to send RTP packets directly. This is makes
users unable to send retransmissions to a single RTPSender.
in /v3 this will go away, only use this API if you really need it.
2020-04-30 00:07:23 -07:00
lawl
cb405472ae RTPSender: Expose the 'track' attribute per spec
The webrtc spec in https://www.w3.org/TR/webrtc/#dom-rtcrtpsender sais
an RtpSender object has a read-only attribute track. We expose this
attribute via a 'Track()' method.
2020-02-18 11:54:47 -08:00
cyannuk
14fa0b54ef Take Track write Lock in NewRTPSender
Track is locking for reading when actually writing
is taking place
2019-12-29 00:08:44 -08:00
Sean DuBois
0d773a38f6 Don't error when no candidate pairs
Fix inconsistency with error handling when we have no candidate pairs.
Before we had custom code in RTP handling that would discard errors
if it was because we had no candidate pairs. Move this logic into the
mux so we have consistent behavior with Datachannels

This can be expected and is a soft failure. Every subsystem is expected
to handle lossy communication.

Resolves #706
2019-06-08 17:51:18 -07:00
Sean DuBois
e8fe7aa48d Bump SRTP/RTCP and update RTCP API
Reading/Writing RTCP packets now return a slice

Relates to pion/srtp#29
2019-04-11 16:03:26 -07:00
Max Hawkins
1e80cb7e46 Upgrade pion/rtcp to v1.1.5
Closes #581
2019-04-07 13:23:35 -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
6c0e8b8851 Return io.EOF when Track has no RTPSenders
Using this enum allows people to more gracefully handle shutdown,
also add a test to assert io.EOF is returned in other places

Resolves #511
2019-03-31 12:00:40 -07:00
Sean DuBois
776c551307 Don't notify users via Track of ICE errors
Writing to a Track shouldn't return errors for an individual
RTPSender. This filters ErrNoCandidatePairs from being returned
and instead just returns nil

Resolves #523
2019-03-29 17:16:35 -07:00
Sean DuBois
ab816402cf Bump pions/rtcp and pions/srtp
RTCP v1.1.2 has breaking API, different return type for Unmarshal
2019-03-16 22:53:16 -07:00
Luke Curley
08a93d89ba Optimize Read by buffering
Increases the Read performance to acceptable levels. Packet loss went
from roughly 8% to 0.5% with this change.
2019-03-12 21:34:48 -07:00
Alex Browne
0f1ddf0825 Add JavaScript/WASM bindings
Resolves #478. Adds minimal JavaScript/WASM bindings. This makes it
possible to compile core parts of pions/webrtc to WASM and run it in the
browser. Only data channels are supported for now and there is
limited/no support for certificates and credentials.
2019-03-08 00:26:17 +01:00
Sean DuBois
67ac22edd2 Update to use new RTCP API
This bumps SRTP and our own RTCP handling to use new API

Resolves #495
2019-03-07 13:16:01 -08:00