Commit Graph

35 Commits

Author SHA1 Message Date
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
mxmCherry
abd6448925 Add RTPSender.hasSent helper
Mostly for PeerConnection.AddTrack RTPTransceiver filtering.

Also, removed nil-check for RTPSender.track:
1) RTPSender is always instantiated with PeerConnection.NewRTPSender
2) PeerConnection.NewRTPSender returns error if nil track passed
2019-03-06 00:08:11 +02:00
Michael MacDonald
b8f3e36b00 Add OnSelectedCandidatePairChange callback
Invoked when the selected ICE candidate pair changes.
2019-03-01 08:07:42 -05:00
Luke Curley
31b7044955 Expose Encodings variable for ORTC
It's not possible to use a RTPReceiver without it.
2019-02-26 00:06:35 -08:00
Sean DuBois
6aeb3425b0 Move to new Track API
See v2.0.0 Release Notes[0] for all changes

Resolves #405

[0] https://github.com/pions/webrtc/wiki/v2.0.0-Release-Notes#media-api
2019-02-25 23:44:09 -08:00
backkem
a1159049a1 Move RTPSender and RTPReceiver to API
Relates to #379
2019-02-22 09:42:50 +01:00
Max Hawkins
c6592e6c4b Rename Ssrc -> SSRC
This capitalization is consistent with other uses in the project,
and matches the Go convention of capitalizing initialisms.

https://github.com/golang/go/wiki/CodeReviewComments#initialisms

Relates to #417
2019-02-18 11:47:05 -08:00
Max Hawkins
0647ce9c26 Remove rtc prefix from filenames
Relates to #408
2019-02-17 16:22:56 -08:00