Commit Graph

2053 Commits

Author SHA1 Message Date
Sean DuBois
70fb90c7fd Fix Simulcast routine leak
When a new SSRC is seen we start a Read loop for the packets. However if
we only see one packet this loop will just sit forever. If a user
doesn't send us enough packets to finish probing it will prevent any
subsequent streams from being probed.

Relates to #1345
2020-12-07 09:18:15 -08:00
Juliusz Chroboczek
0dea1f91e0 Fix RTPSendParameters
RTPSendParameters contains an array of encodings.
RTPSender.GetParameters returns RTPSendParameters.
v3.0.0-beta.15
2020-12-05 23:02:27 -08:00
tarrencev
5ee9a316a9 Export mime types
Export mime types from media enginer for matching
2020-12-06 00:58:06 -05:00
Juliusz Chroboczek
92055aedc8 Implement Codec() for local static tracks
This is analoguous to remote tracks, but returns just RTPCodecCapability
rather than RTPCodecParameters.
2020-12-05 12:53:49 -08:00
Renovate Bot
7b1a63243a Update module pion/rtcp to v1.2.6
Generated by renovateBot
2020-12-04 15:11:07 -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
c4d786521c Reduce TestPeerConnection_Interceptor complexity
Use assert when possible
2020-12-03 22:10:26 -08:00
Renovate Bot
442188c408 Update module pion/rtcp to v1.2.5
Generated by renovateBot
2020-12-03 21:03:19 -08:00
mission-liao
f484fcbf6b Add option to add hook for packets released
This hook allow us to recycle the packet buffer via sync.Pool.
2020-12-03 09:49:28 -08:00
OrlandoCo
eef91ea5ac Fix media sample duration calculation
Add float casting to time duration calculation to get correct result
2020-12-02 22:02:36 -08:00
Renovate Bot
26df835441 Update module pion/interceptor to v0.0.5
Generated by renovateBot
2020-12-02 20:32:25 -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
Sean DuBois
3da29b7c0c Write/WriteRTP shouldn't block before SRTP
A Track shouldn't block until a PeerConnection is connected. It should
only send to PeerConnections that are fully established. v3 Track API
changed this behavior by mistake.

Related to pion/transport#116
2020-12-02 19:25:43 -08:00
baiyufei
63e241f63f Improve H264Reader performance
Fixes #1559
2020-12-01 15:49:36 -08:00
Renovate Bot
3994aba14d Update golang.org/x/net commit hash to 5d6afe9
Generated by renovateBot
2020-12-01 15:22:05 -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
16b313b492 Take copy of rtp.Packet in WriteRTP
Otherwise we will modify user input. In the future we can investigate
ways to optimize.
2020-11-29 23:39:15 -08:00
Pion
c2e3688a3c Update CI configs to v0.4.17
Update lint scripts and CI configs.
2020-11-28 22:39:52 -08:00
Sean DuBois
dc015e1b17 Update pion/ice
v2.0.12 => v2.0.13
2020-11-28 22:25:37 -08:00
Renovate Bot
5a7b2ce6f8 Update module pion/transport to v0.11.0
Generated by renovateBot
2020-11-28 22:02:42 -08: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
Renovate Bot
9ac8e9060f Update module pion/dtls/v2 to v2.0.4
Generated by renovateBot
2020-11-26 23:04:34 -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
00ec48af63 Don't run OnNegotiationNeeded if handler not set
Reduce the amount of code that is running if we don't need this.

Relates to #1494
v3.0.0-beta.14
2020-11-23 10:06:04 -08:00
Sidney San Martín
6430e63e79 Fix how assert-contributors.sh handles my name
Change the README to use the canonical "San Martín" (LATIN SMALL LETTER
I WITH ACUTE) and ignore the "San Martín" (LATIN SMALL LETTER I +
COMBINING ACUTE ACCENT) version.
2020-11-22 22:35:51 -08:00
Sidney San Martín
e1efa5d6f4 Compute an MSID to compare with the SDP
The MSID won't match the track's StreamID() on its own.
2020-11-22 22:35:51 -08:00
Sean DuBois
d0b119af2a Remove addStream from Javascript
Not supported in Safari
2020-11-19 21:23:57 -08:00
Sean DuBois
74e790aa11 Update to pion/sdp@v3.0.3
Minor API changes
v3.0.0-beta.13
2020-11-18 22:05:21 -08:00
Sean DuBois
a218b857bd Implement RTPSender.ReplaceTrack
Resolves #1020
2020-11-18 21:50:27 -08:00
OrlandoCo
3333b65c01 Make WithMediaEngine to receive a pointer
These change will allow to use the MediaEngine outside Pion context
2020-11-18 10:56:29 -08:00
Suzuki Takeo
1ffa87eb07 Fix oggwriter creating invalid first page
previousTimestamp default value is not 0 but 1
2020-11-17 20:14:41 -08:00
Bo Shi
32c082f6ff Avoid blocking resource release by client code
The change in #1520 unnecessarily waits for a client-provided callback
to complete before release resources that are no longer necessary.
Won't have any impact in microbenchmarks that have no-op callbacks.
Release as early as possible.
2020-11-17 11:23:18 -08:00
Sean DuBois
661f5b83dd Use Trickle ICE for TestICERestart
Test both paths
2020-11-16 22:48:44 -08:00
Sean DuBois
29f8b446de Simplify TestNegotiationNeededStressOneSided
Remove network interaction from test, just assert that
answerer gets all the expected Transceivers
2020-11-16 21:13:55 -08:00
Sean DuBois
4a80d10fd8 Simplify TestNegotiationNeededStressOneSided
Test still asserts that `OnNegotiationNeeded` is able to signal all
500 tracks.
2020-11-16 19:06:25 -08:00
Sean DuBois
5498e93083 Fix dataChannelsRequested race
Take pc.sctpTransport lock before accessing
2020-11-16 14:27:51 -08:00
Sean DuBois
9a57609a62 Make ICETransport state atomic.Value
Remove the need to take the lock when firing OnICEConnectionStateChange
2020-11-16 13:49:25 -08:00
Sean DuBois
49ddb9dab8 Make DataChannel.ReadyState atomic
Fix deadlock, see trace in issue

Resolves #1531
2020-11-16 13:49:25 -08:00
Sean DuBois
9c9beb7335 Update github.com/pion/ice
pion/ice/v2@v2.0.11
2020-11-16 13:49:25 -08:00
Pion
a737595534 Update CI configs to v0.4.15
Update lint scripts and CI configs.
2020-11-16 12:18:44 -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
Bo Shi
159ba5aca3 Reduce memory allocated in DataChannel.readLoop
See https://github.com/pion/webrtc/issues/1516

This patch preserves the semantics of the OnMessage handler and is
more safe but less efficient than the patch first described in #1516.

$ git checkout origin/master datachannel.go && \
  go test -bench=. -run=XXX -benchmem -count=10 > original.txt
$ git checkout datachannel.go && git apply pool.patch && \
  go test -bench=. -run=XXX -benchmem -count=10 > option1.txt

$ benchstat original.txt option1.txt
name                 old time/op    new time/op    delta
DSend2-8     20.3µs ±51%     3.7µs ± 6%   -81.74%  (p=0.000 n=10+10)
DSend4-8     23.5µs ±34%     3.6µs ± 8%   -84.80%  (p=0.000 n=10+8)
DSend8-8     18.9µs ±35%     5.8µs ±68%   -69.45%  (p=0.000 n=9+10)
DSend16-8    16.8µs ±30%    10.0µs ±24%   -40.77%  (p=0.000 n=10+10)
DSend32-8    710ms ±100%       0ms ±81%  -100.00%  (p=0.035 n=10+9)

name                 old alloc/op   new alloc/op   delta
DSend2-8     15.3kB ±89%     1.4kB ± 0%   -90.59%  (p=0.000 n=9+10)
DSend4-8     41.7kB ±63%     1.4kB ± 1%   -96.58%  (p=0.000 n=10+10)
DSend8-8     45.0kB ±33%     1.4kB ± 2%   -96.83%  (p=0.000 n=9+10)
DSend16-8    34.0kB ±69%     1.4kB ± 1%   -95.77%  (p=0.000 n=10+10)
DSend32-8   37.4MB ±388%     0.0MB ± 4%  -100.00%  (p=0.000 n=10+7)

name                 old allocs/op  new allocs/op  delta
DSend2-8       15.8 ±46%      38.6 ± 2%  +144.30%  (p=0.000 n=10+10)
DSend4-8       27.1 ±48%      38.0 ± 0%   +40.22%  (p=0.000 n=10+9)
DSend8-8       29.3 ±16%      38.0 ± 0%   +29.55%  (p=0.000 n=9+8)
DSend16-8      23.6 ±41%      37.0 ± 0%   +56.78%  (p=0.000 n=10+9)
DSend32-8    19.3k ±100%      0.0k ± 0%      ~     (p=0.178 n=10+7)
2020-11-14 14:39:22 -08:00
Sean DuBois
c25a18ba99 Update CI configs to v0.4.13
Update lint scripts and CI configs.
2020-11-14 14:38:35 -08:00
Sean DuBois
79d93e9835 Add TestICERestart_Error_Handling
Add test that asserts that a DataChannel message that is sent while
disconnected will be delivered after reconnected.

Relates to #1518
2020-11-13 05:21:37 -08:00
Sean DuBois
43f3b47307 Revert TestICERestart_Error_Handling
We need to fix pion/ice#252 first
2020-11-12 23:51:49 -08:00
Sean DuBois
8bff7190b0 Add !js to vnet
SettingEngine is not available in WASM
2020-11-12 23:34:23 -08:00
Sean DuBois
50e4975877 Add TestICERestart_Error_Handling
Add test that asserts that a DataChannel message that is sent while
disconnected will be delivered after reconnected.

Relates to #1518
2020-11-12 22:51:30 -08:00
Sean DuBois
ec2658440e Simplify TestNegotiationTrackAndChannel
We already have extensive tests for tracks. Update this test
to just assert that CreateDataChannel fires OnNegotiationNeeded.
2020-11-12 15:52:44 -08:00
o0olele
d71bd9aa2a Fix JS error in insertable-streams example
Member has been changed from `readableStream` -> `readable`
2020-11-12 14:24:13 -08:00