Commit Graph

24 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
Markus Tzoe
b6ca48ea6d PeerConnection: more thread-safe
now proctected by lock:
	- CreateOffer
	- CreateAnswer
	- AddTransceiverFromKind
	- AddTransceiverFromTrack

newRTPTransceiver is no longer a PeerConnection method;
pc.addRTPTransceiver would fire onNegotiationNeeded;
pc.AddTrack, pc.RemoveTrack now hold lock for the entire function;

Fixes TestNegotiationNeededStressOneSided() by waiting til all
tracks added to pcA and the negotiation completed
2021-04-23 11:12:48 +08:00
Jerko Steiner
6465248f1e Fixes for pre-added recvonly transceivers
Which were previously unable to:

1. have a sending track set to them, or
2. receive a track after renegotiation.

I'm not 100% sure if this covers all cases where a track is added and
removed and then added again. BUT IIRC there was a change that did not
allow transceiver reuse after a track was removed from it. Again, not
100% sure.

Fixes #1722.
2021-03-21 11:50:52 +01:00
aler9
ae0f74edff Set answer as sendonly in case of a recvonly offer
When a local peer connection has a single transceiver with a sendrecv
direction, and the remote has a transceiver with a recvonly direction,
the local peer connection must change the transceiver direction to
sendonly.

When a local peer connection has a single transceiver with a recvonly
direction, and the remote has a transceiver with a recvonly direction,
the local peer connection must create another transceiver with a
sendonly direction.

A unit test is added to cover all possible cases.
2021-02-22 15:23:27 -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
OrlandoCo
5104499373 Add RTPTransceiver.SetSender
This non-standard API allows us to re-use existing transceivers.
The WebRTC API causes SDP bloat right now since it doesn't allow
the re-use of existing media sections.
2020-11-04 12:47:29 -05: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
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
Pion
0466659207 Update CI configs to v0.4.5
Update lint scripts and CI configs.
2020-09-09 22:09:23 -07:00
Jason
6ee528d349 Add Simulcast support
Resolves #1016
2020-07-24 01:01:43 -07:00
Jerko Steiner
8013159fff Add RTPTransceiver.Mid()
Refactor existing code for Unified Plan to ensure the same transceiver
will always be associated with the media description by mid.
2020-04-29 09:05:42 +02:00
Sean DuBois
5f54b68899 Add examples/play-from-disk-renegotation
Resolves #207
2020-02-09 21:40:37 -08:00
Sean DuBois
0b8bdebeeb Make RTPTransceiver thread safe
Sender, Receiver and Direction are now atomics with functions
for getters and setters

Relates to #207
2020-02-09 21:40:37 -08:00
Sean DuBois
512a7d3330 Implement RemoveTrack
RemoveTrack properly removes the Sender, and culls
the RtpReceiver on the remote

Relates to #207
2020-02-09 21:40:37 -08:00
Sean DuBois
53014d3eb8 Move SDP code into dedicated file
Remove some duplication that makes re-negotiation harder.
By splitting parsing of inbound SDP and creation of outbound
it makes the next step a lot easier.

Relates to #207
2020-02-09 21:40:37 -08:00
Sean DuBois
f1ffb81649 Remove code duplication in track/transceiver code
Have AddTrack call transceiver code. Also update AddTransceiverFromKind
to call AddTransceiverFromTrack

Relates to #207
2020-02-09 21:40:37 -08:00
Sean DuBois
775a521176 Don't store transceiver MID
These are generated at runtime (depending if we are doing Plan-B or
Unified Plan). Currently this field is actually unused, so just getting
rid of it.

Relates to #106
2019-07-22 21:31:39 -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
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
43604d5491 Remove pkg/errors dependency
Lots of people are paying attention to what dependecies we add to their
projects now. This just makes things a little cleaner.

Resolves #469
2019-03-06 09:34:10 -08:00
mxmCherry
3bc9a312bb Check Sender.track assigning for nil
It does not make sense to have Sender.track == nil
2019-03-06 00:08:11 +02:00
Sean DuBois
71053c1e16 Add lint for filenames
We have established a pattern of Alpha and underscores for filenames.
This adds a hook to keep this pattern going. Also fixes a misnamed file
I found in the process.

Resolves #456
2019-02-27 23:14:20 -08:00