Juliusz Chroboczek
1130295e0b
Use strings.EqualFold for comparing codec names.
2021-05-12 16:18:23 +02:00
Juliusz Chroboczek
c53cc20d26
Use Write instead of WriteRTP in the downTrack interface.
2021-05-11 23:48:17 +02:00
Juliusz Chroboczek
b09dba0e26
Remove FIR sending code.
...
We no longer send FIRs.
2021-05-11 23:46:57 +02:00
Juliusz Chroboczek
d3f53e6ada
Move rate estimation into rtpDownTrack.WriteRTP.
2021-05-11 22:45:33 +02:00
Juliusz Chroboczek
c52e1f4ce0
Move keyframe handling to the sender side.
...
This is simpler and gets rid of ErrKeyframeNeeded.
2021-05-11 22:36:56 +02:00
Juliusz Chroboczek
b2ea8e8533
Move isKeyframe into its own file.
2021-05-11 19:59:24 +02:00
Juliusz Chroboczek
26bf8a341a
Don't send client parameters in delete message.
...
This avoids a race condition since the delete messages are sent
asynchronously.
2021-05-10 16:58:28 +02:00
Juliusz Chroboczek
795a40ceaf
Simulcast.
2021-05-08 21:12:29 +02:00
Juliusz Chroboczek
ed88a7a4b5
Fix typo in REMB sending.
2021-05-08 18:51:15 +02:00
Juliusz Chroboczek
65972fabe8
Remove dead code.
2021-05-08 16:03:32 +02:00
Juliusz Chroboczek
86b6c71ca0
Reformat stats display, protect against division by zero.
2021-05-07 02:23:10 +02:00
Juliusz Chroboczek
3a6ade988d
Export stats as JSON.
2021-04-30 20:17:10 +02:00
Juliusz Chroboczek
9b1d814b58
Rework packetcache loss statistics.
...
Don't maintain loss, which is too error-prone. Instead, maintain
expected and received packet counts, and compute loss from that.
2021-04-30 16:26:17 +02:00
Juliusz Chroboczek
cd6920d7e2
Allow group.API() to fail.
2021-04-29 21:10:04 +02:00
Juliusz Chroboczek
be73380f9f
Label streams, not tracks.
...
We used to label tracks individually, in a view to using the labelling
for simulcast. Since then, the WebRTC community has converged on a
different strategy, where multiple tracks share a single mid and
are labelled with the rid extension.
We now label whole streams, which is simpler, and use the track's
kind (and, in the future, the rid) to disambiguate. This changes the
protocol in two ways:
* in offers, the "labels" dictionary is replaced by a single "label"
field; and
* the syntax of the "request" message has changed.
2021-04-29 18:28:16 +02:00
Juliusz Chroboczek
3ba2394be7
Implement user statuses.
...
The server now maintains a set of statuses for each user that are not
interpreted by the server but communicated to the other members of the
group using 'user' messages.
2021-04-28 17:01:05 +02:00
Juliusz Chroboczek
f0a39fca48
Send user permissions to client.
...
We now maintain the user list in the serverConnection.
2021-04-28 00:07:19 +02:00
Juliusz Chroboczek
fef38bc53f
Protect against requesting when no group is joined.
...
Thanks to gregfr.
2021-04-15 12:07:05 +02:00
Juliusz Chroboczek
ea321be17a
Make Kick part of the Client interface.
...
All clients implement Kick, no need for a separate interface.
2021-02-26 16:20:13 +01:00
Juliusz Chroboczek
ddb6039fa6
Fix error handling in client actions.
...
Thanks to Yacine.
2021-02-17 20:55:11 +01:00
Juliusz Chroboczek
260597d595
Ensure actions happen in order.
2021-02-15 00:35:09 +01:00
Juliusz Chroboczek
183ab4fed7
Use an unbounded buffer for client actions.
...
We no longer risk deadlocking when sending actions, which in turn
enables pushing connections synchronously.
2021-02-14 17:24:42 +01:00
Juliusz Chroboczek
3b505a89fe
Factor out handling actions.
2021-02-14 16:47:36 +01:00
Juliusz Chroboczek
3c7b32056b
Reduce writer timeout, increase amount of buffering.
...
If the writer gets congested, the whole group might be delayed. Better
to drop the slow client in that case.
2021-02-14 16:26:56 +01:00
Juliusz Chroboczek
fe83f61998
Don't complain about ErrClosedPipe in RTCP receiver.
...
This simply indicates that the server closed the connection
before we received the close indication from the client.
2021-02-11 16:19:36 +01:00
Juliusz Chroboczek
0261558e07
Protect against empty ids.
2021-02-05 16:07:58 +01:00
Juliusz Chroboczek
c3a19c9128
Avoid race between closing connections and terminating client.
...
We need to terminate all down connections synchronously, otherwise
we risk leaving open connections lying around.
2021-02-05 12:20:33 +01:00
Juliusz Chroboczek
66de0d16e7
Fix closing of replaced connections.
2021-02-04 23:51:51 +01:00
Juliusz Chroboczek
0ce509c62c
Revert "Log client errors."
...
We're already logging in the caller.
This reverts commit f4811e8cf5
.
2021-02-04 22:44:14 +01:00
Juliusz Chroboczek
263258a0c1
Implement renegotiation of down streams.
...
We used to destroy and recreate down streams whenever something changed,
which turned out to be racy. We now properly implement renegotiation,
as well as atomic replacement of a stream by another one.
2021-02-03 19:15:40 +01:00
Juliusz Chroboczek
6c4a71fda0
Increase timeout for connection completion.
2021-02-02 23:12:52 +01:00
Juliusz Chroboczek
f34ec0ab66
Don't hide mismatches in the PeerConnection state automaton.
...
The previous behaviour led to silent failures, which was confusing.
2021-02-02 22:57:56 +01:00
Juliusz Chroboczek
f4811e8cf5
Log client errors.
2021-02-02 22:46:54 +01:00
Juliusz Chroboczek
d9e72f4fd0
Return an error when adding a duplicate down track.
2021-02-02 22:46:48 +01:00
Juliusz Chroboczek
73f72c45fc
Fix race in pushConn.
2021-02-02 22:46:40 +01:00
Juliusz Chroboczek
36d6845dc1
Fix closing of replaced connections.
2021-02-01 14:08:54 +01:00
Juliusz Chroboczek
14a4303664
Rework connection replacement.
...
We used to signal connection replacement by reusing the same connection
id. This turned out to be racy, as we couldn't reliably discard old
answers after a connection id was refused.
We now use a new id for every new connection, and explicitly signal
stream replacement in the offer message. This requires maintaining a
local id on the client side.
2021-01-31 23:59:17 +01:00
Juliusz Chroboczek
fb17778ba6
Increase receiver report timeout.
2021-01-21 21:19:07 +01:00
Juliusz Chroboczek
f0dcd0b1d9
Rework locking of tracks.
...
We now add tracks after the stream has been pushed, so we need a lock
on down streams. Also rework sendUpRTCP to reduce locking.
2021-01-19 23:55:33 +01:00
Juliusz Chroboczek
9a5c8b6b43
Handle answers in stable state.
...
Don't break the stream, just ignore the SDP.
2021-01-19 23:30:01 +01:00
Juliusz Chroboczek
6098d4af9d
Implement autolock.
2021-01-14 03:56:37 +01:00
Juliusz Chroboczek
49bcc342ed
Queue negotiation if not in stable state.
...
If we send two offers back to back, the second answer will arive in
stable state, which will confuse us. Instead, queue the second offer.
2021-01-12 20:44:48 +01:00
Juliusz Chroboczek
820b303e84
Send localDescription instead of original SDP.
2021-01-11 20:41:34 +01:00
Juliusz Chroboczek
dad113c1f9
Generate transceivers from incoming SDP.
2021-01-11 20:24:09 +01:00
Juliusz Chroboczek
63e2b5a4c4
Implement 'noecho' field in client messages.
2021-01-11 16:30:07 +01:00
Juliusz Chroboczek
617aee325f
Reduce ping timetout to 45 to 55s.
...
Thanks to Jeroen van Veen for the debugging.
2021-01-08 14:05:02 +01:00
Juliusz Chroboczek
7f4306ab3b
Optimise broadcast messages.
...
Avoid formatting JSON multiple times.
2021-01-04 18:28:54 +01:00
Juliusz Chroboczek
80cb0a2f30
Simplify VP9 keyframe detection.
2021-01-03 20:55:35 +01:00
Juliusz Chroboczek
0ec9f92dad
Make 'clearchat' into a user message.
2021-01-03 17:47:56 +01:00
Juliusz Chroboczek
e393819eda
Carry raw SDP in the protocol.
2021-01-03 17:00:58 +01:00