Commit Graph

23 Commits

Author SHA1 Message Date
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