64 Commits

Author SHA1 Message Date
Shreyas Jaganmohan
4c1261ff83 Add inbound-rtp stats
Remove comments

Add collectStats test

Fix linter issues

Remove comment

Fix tests

Address comments

Fix comment

Fix function comment
2025-09-18 23:25:24 +02:00
arjunshajitech
7a94394db0 Log error when Read is used with simulcast 2025-07-25 14:13:39 +05:30
Joe Turki
22dd7b733b Replace interface{} with any 2025-06-19 23:44:08 +03:00
LeeTeng2001
306dc37769 Fix error handling in RTPReceiver.Receive
If we failed to startReceive we would still make the Receiver as ready
to start reading.
    
Fixes #2929
2025-02-12 11:47:42 -05: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
32f7063f1a Send FEC and RTX PayloadType into interceptor
New fields added to interceptor.StreamInfo
2024-10-04 21:33:10 -04: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
cnderrauber
021c271a92 Fix our-of-order twcc fb cause by rtx blocked
Fix #2830. The TrackRemote.Read could block in
readRTP if the buffer is empty then rtx packets
arrival before next media rtp packet will be
readed after the next media rtp packet and cause
out-of-order fb and mess up remote peer's
bandwidth estimation.
2024-07-25 23:03:28 -05:00
Sean DuBois
c85269bee3 Properly handle non-media probes
libwebrtc has started sending media probes on an unannounced SSRC(0).
Currently Pion will ignore this as the SSRC hasn't been declared
explicitly and no RID/MID RTP Headers.

This adds a special case to accept SSRC 0 and Read the RTP packets. This
allows the TWCC reports to properly be generated.
2024-07-20 22:16:22 -04:00
cnderrauber
83cfeea397 Update RtxSSRC for simulcast track remote
Fix #2751, updates remote track's rtx ssrc for
simulcast track doesn't contain rtx ssrc in sdp
since readRTX relies on rtx ssrc to determine if
it has a rtx stream.
2024-04-25 09:54:36 -04:00
cnderrauber
dae5e8e1a0 Skip padding packet for simulcast probe
Skip padding packet for simulcast probe
Fix rtx attributes panic for nil map
2024-02-01 22:57:05 -08:00
Adrian Cable
6de39bf37a RTX attribute constants should be public 2023-10-08 09:38:45 -07:00
cnderrauber
a5b81a16c4 Fix data race of RTX packet
Fix data race of RTX packet
2023-10-01 10:56:42 -07:00
Adrian Cable
e5705310fd Allocationless handling of RTX pkts 2023-09-29 14:00:48 -07:00
Adrian Cable
ff34ec9b67 Read() handles distinct-SSRC RTX packets 2023-09-29 14:00:48 -07:00
Sean DuBois
c0437dc93d Add Simulcast RTCP Test
Resolves #1803
2023-09-15 00:41:01 -04:00
Sean DuBois
dc4b591c4d Start pion/webrtc/v4
60eea43 is a breaking change
2023-09-05 11:48:14 -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
do-hyung-kim
b40f599c25 Add RTPReceiver.RTPTransceiver
Returns the RTPTransceiver currently associated with this RTPReceiver
2023-08-02 10:19:37 -04:00
Steffen Vogel
683fc837d0 Make repo REUSE compliant 2023-05-05 11:58:49 -04:00
Pion
308f8616a3 Update CI configs to v0.10.6
Update lint scripts and CI configs.
2023-04-08 14:24:19 -04:00
boks1971
04ca4493f6 Set up RTP Receivers synchronously
Do the set up of RTP receivers synchronously so that they
are ready to receive media as soon as signalling to remote
side is sent. Once signalling to remote side is sent, the
remote can send media at any time and receiver has to be ready.

Like the bug mentions, a negotiation quickly followed by
a renegotiation left the RTP receivers of the tracks in the
second offer not set up. If the tracks in the renegotiation
happen to be simulcast tracks, they are missed as browsers
send RID only in the first few packets.

The problem can be reproduced by introducing a 1 second
delay in Downstream direction in Network Link Conditioner
and using a modified version of LiveKit JS SDK sample app to
force a double negotiation spaced closely.

With this change, onTrack fires, but the unhandled warning
from RTCP for the highest layer still happens. But, the
track fires almost immediately following that warning
(less than 5 ms later). So, all the simulcast layers
are available.

Resolves #2054
2022-01-17 14:57:24 -05:00
Sean DuBois
80da22268a Handle non-Simulcast Repair Streams
Same issue with TWCC enabled as 11b887. We need to process the
RTX packets so that we can emit proper reports.
2021-10-04 22:08:27 -04: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
Sean DuBois
a630d62dd4 Move Simulcast SDP Modification into helper
Will be used by Simulcast renegotation tests as well

Relates to #1345
2021-08-29 20:54:44 -04:00
Sean DuBois
d570b78ae1 Implement SSRC Based Simulcast
Resolves #1345
2021-08-28 11:00:44 -04:00
Sean DuBois
89042ee5f6 Don't consider simulcast for undeclared SSRC
If we have a media section with no SSRC we would fire an OnTrack. This
code now properly ignores a MediaSection that has a rid attribute.

Resolves #1808
2021-08-24 17:02:21 -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
Antoine Baché
93841964fd Fix RTPReceiver getParameters
When used with ORTC, a RTPTransceiver might not be set
and a call to getParameters would result in a crash
2021-07-13 15:25:56 +02: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
Antoine Baché
41243cd179 Implemented RTPReceiver SetRTPParameters for ORTC
RID is now set on remote tracks, if provided
Adds SetRTPParameters which can be used in ORTC to set codec information
about the remote track
2021-06-17 22:39:16 +02: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
1dedfd8c28 Refine SetReadDeadline behavior
- Refine RTPReceiver.SetReadDeadline behavior

  Instead of iterating over r.tracks, just calling r.tracks[0]
  directly. This behavior follows RTPReceiver.Read.

- Add RTPReceiver.SetReadDeadlineSimulcast

  Its fingerprint follows RTPReceiver.ReadSimulcast.

- Refine RTPReceiver.setRTPReadDeadline

  It will only timeout the RTP stream for the track makes the call.
2020-12-28 14:40:38 +08:00
Sean DuBois
398c363baf Add SetReadDeadline to RTPReceiver and TrackRemote
Previously, Reading RTP or RTCP packets from a peer
would block until a packet was received, or the
connection was terminated. This change allows you to
set a deadline, after which the read function will
return a timeout error and you can get on with other
things.

Resolves #1553
2020-12-26 09:41:45 -08:00
tarrencev
a54b74cdb7 Update pion/interceptor for NACKs
Generate + Respond interceptors
2020-12-14 21:40:09 -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
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
7c2352003b Update pion/srtp and pion/transport
Removes context usage
2020-12-02 20:20:03 -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
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
OrlandoCo
65400221ec Add methods to read Simulcast RTCP
Add ReadSimulcastRTCP and ReadSimulcast to RTPReceiver
2020-10-15 12:11:32 -07:00
OrlandoCo
3f53b70405 Fix receiver close stream race close
Add nil check in RTPReceiver.Stop()

Fixes #1471
2020-10-09 09:27:31 -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
Jason
6ee528d349 Add Simulcast support
Resolves #1016
2020-07-24 01:01:43 -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
Simon Eisenmann
85ee4600a9 Fix RTPReceiver Stop race
RTPTranseiver closees its streams on Stop if any have been received.

The receive trigger is closed as soon as the Receive function is called.
This is too early since the streams are added only directly after and
also there is the possibility that all or only one of the following
stream opens fail.

This change ensures that the receive channel is closed after all streams
have potentially been added. At the same time a check is added to ensure
that only streams which are actully opened are closed.
2020-04-01 20:16:47 +02:00
Sean DuBois
6847421118 Implement Adding tracks after signaling
Relates to #207
2020-02-09 21:40:37 -08:00