Commit Graph

121 Commits

Author SHA1 Message Date
Raja Subramanian
fe8c355a32 Support participant identity in permissions (#663)
* Support participant identity in permissions

It is harder for clients to update permissions by SID as remote
reconnecting means a new SID for that participant. Using participant
identity is a better option.

For now, participant SID is also supported. Internally, it will
get mapped to identity. Server code uses identity throughout after
doing any necessary conversion from SID -> Identity.

* Address comments
2022-05-02 12:35:20 +05:30
Raja Subramanian
43d0573693 Moving smoothing into the audio level module. (#636) 2022-04-20 23:59:51 +05:30
Raja Subramanian
cf627d8bbe Send adaptive stream param in join (#626) 2022-04-19 16:45:35 +05:30
Raja Subramanian
50bd08e551 ICE restart - dynacast settings were lost (#620)
* Prevent stats update if the deltas are empty

* increase force interval

* static check

* Change max delay to 30 seconds

* Restart the max subscribed quality timer on ICE restart.

Force an update after a restart to let clients apply dynacast settings.
Also, set the max expected layer to HIGH on restart so that stream
tracker starts up fast on a restart.

* fix test
2022-04-18 22:58:11 +05:30
cnderrauber
f74144846b create new subscriber datatrack after migration (#600)
* use negotiated data channel in migration case

* create subscriber data track after migration

* fix participant state update

* add participant leave log

* update protocol
2022-04-07 15:43:24 +08:00
David Colburn
0b8a180554 Code inspection (#581)
* Code inspection

* fix [4]int64 conversiong
2022-03-30 13:49:53 -07:00
David Zhao
5920672802 feat: unpublish tracks after publish permissions are revoked. (#545)
* feat: unpublish tracks after publish permissions are revoked.

Uses protocol 7 to indicate client support, otherwise it attempts to
mute the tracks.

Also sends back permissions objects of all participants, and cleaned up
our handling of various permissions attributes.

* fix static check
2022-03-21 00:20:48 -07:00
cnderrauber
61ac44e5f7 Revert data track change (#513)
* Revert data track change

* clean code
2022-03-15 19:30:10 +08:00
Raja Subramanian
be02611ab7 Locks around data track (#508)
* WIP commit

* Fix migration, thank you Jie
2022-03-12 20:10:46 +05:30
cnderrauber
128199e634 don't send datatrack info to client (#492)
* don't send datatrack info to client
2022-03-08 17:05:26 +08:00
cnderrauber
608da4ba4b stats for pli and bitrate (#487)
* stats for pli and bitrate

* solve comments

* return 0 if no pli sent
2022-03-07 14:59:01 +08:00
David Zhao
7a5b5dbc69 Pass back serverRegion in when participant's joining (#479)
* Pass back serverRegion in when participant's joining

* fix tests

* protocol update
2022-03-02 13:36:19 -08:00
cnderrauber
913ef3a646 Datatrack for data channel (#476)
* data track
2022-03-01 15:48:20 +08:00
cnderrauber
c2d3e6e33e create data channel from sync state (#469)
* create data channel from sync state

* fix fake type
2022-02-25 18:32:02 +08:00
Raja Subramanian
3f38172139 Types for ConnectionID, NodeID, ParticipantKey (#450)
* Types for ConnectionID, NodeID, ParticipantKey

* latest protocol version
2022-02-21 08:52:11 +05:30
Raja Subramanian
222b02aa73 RTT (#420)
* Consolidating PLI throttle

Use the throttler in `sfu.WebRTCReceiver`.

Does change shape of config object.

* Move PLIThrottleConfig to sfu.WebRTCReceiver

* fix test compile

* Cleaning up unused stuff

* improve readability

* RTT

- Calculate down track RTT using RTCP Receiver report
- Surface it back to the participant
- Participant updates all its published trackes
  (throttled to limit update to once in 5 seconds)
- That propagates to all the upstream sfu.Buffer and the nacker.
  So, we will have RTT throttled NACKs.

* rtt callback
2022-02-09 09:34:40 +05:30
Raja Subramanian
d3ca4a37a8 Proper context for down track logger (#416)
It was having two participants (both publisher and subscriber).
Fix it by getting logger from susbcriber and adding track context.
2022-02-08 15:54:45 +05:30
Raja Subramanian
36289bbca7 FPS (#410)
* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* WIP commit

* Clean up

* Clean up

* Store RTT in stats

* spelling mistake

* Make tests compile

* Fix test compilation error

* fix tests

* clone

* latest protocol
2022-02-08 12:53:14 +05:30
David Zhao
6f6d55345b Use ParticipantInfo version to ensure consistency (#399)
* Use ParticipantInfo version to ensure consistency

Deprecating time.Time and avoid locking unnecessarily

* properly adjust ulimit. update protocol

* Save initial version from params

* get rid of metadata field, use grants copy

* fix test
2022-02-03 17:10:52 -08:00
David Zhao
a8d43aab67 Uses IceLite only for protocol 6 clients (#397)
* Update to Pion v3.1.20, with fixes DTLS role ambiguity

* Gate ice-lite on protocol version

Co-authored-by: boks1971 <raja.gobi@tutanota.com>
2022-02-02 21:16:08 -08:00
Raja Subramanian
745939ec24 Smoother dynacast transition (#390) 2022-01-31 07:47:24 +05:30
Raja Subramanian
3bfdb2523e Catch some instances of traversing map outside lock (#388)
* one more place, do not range over map outside lock

* Catch one more location

* Catching a couple of more places
2022-01-29 20:14:36 +05:30
David Zhao
9747243ce2 Honor autoSubscribe when subscription permissions are granted later (#381)
* Ensure autosubscribe is honored when subscription permissions were granted later

* negotiate even if no media has been added

* don't double-negotiate
2022-01-28 09:55:10 -08:00
Raja Subramanian
f962fef2c8 Apply subscribed track settsings on add (#379) 2022-01-28 08:34:13 +05:30
David Colburn
e7e3fcac43 remove duplicate IsRecorder 2022-01-24 20:51:57 -07:00
David Colburn
627a93298e IsRecorder (#368)
* IsRecorder

* regenerate fakes
2022-01-24 18:22:10 -07:00
David Zhao
52fc53d325 Issue updated tokens to clients. (#365)
This ensures client reconnect attempts would be successful for long running rooms. It also fixes inaccurate permissions that were set incorrectly when full reconnections take place.
2022-01-23 23:15:49 -08:00
Raja Subramanian
6a46958870 Some receiver clean up (#364) 2022-01-23 08:22:39 +05:30
Raja Subramanian
d1848ab218 Rename UpdateSubscriptionPermissions -> SubscriptionPermission and other renaming (#363)
* Store subscription permission in DB

* Comment out subscription permission to DB

* WIP commit

* Clean up

* clean up

* Latest protocol
2022-01-22 12:16:15 +05:30
cnderrauber
2886ab1e39 RemoveSubscriber through pariticipant (#359) 2022-01-21 12:32:26 +08:00
Raja Subramanian
3d56b7c7f3 Adjustments to allow permissions migration. (#356)
* Adjustments to allow permissions migration.

* Fix tests
2022-01-21 09:43:59 +05:30
cnderrauber
0acb0a9d66 don't send black screen when Track be resumed (#352)
* don't send black screen when Track be resumed

* default flush
2022-01-19 18:14:38 +08:00
David Colburn
5bea9debb7 Code cleanup (#353) 2022-01-19 02:13:06 -08:00
Raja Subramanian
10714b3f6d Adjust interfaces to better work with cloud (#349)
* Adjust interfaces to better work with cloud

* force argument to quality update
2022-01-19 10:28:55 +05:30
Raja Subramanian
f662119ca4 Add roomID to logger util (#345) 2022-01-17 16:36:10 +05:30
Raja Subramanian
e67db84b3b Remove stubs (#331)
* WIP commit

* Use LocalParticipant interface

* Remove no-op local participant

* Remove localparticipant

* Remove no-op stubs

* Consolidate PublishedTrack into MediaTrack
2022-01-12 00:11:48 +05:30
David Zhao
c2ba26eee6 Handle SimulateScenario requests (#330)
* Handle SimulateScenario requests

* actually use sendLeave

* fix local test failures due to filehandle limit
2022-01-11 00:37:24 -08:00
Raja Subramanian
e82b8ea0a0 No op implementation to remove stubs in remote (#327)
* No op implementation to remove stubs in remote

* Place interface first
2022-01-10 19:17:58 +05:30
Raja Subramanian
f3d14f9b04 Rename state for consistency (#325) 2022-01-10 13:31:12 +05:30
Raja Subramanian
a9e0598210 uptrackmanager reuse (#318)
* WIP commit

* Remove the double lock

* Remove unused variable

* WIP commit

* Fix test

* WIP commit

* Split out MediaTrackReceiver

* Address comments from David
2022-01-09 10:45:49 +05:30
cnderrauber
8582ca4c9b Session migration (#319)
* migrate between nodes

* session migration

* bug fix

* use version instead of query parameter

* clean code

* clean

* merge master

* solve comments

* solve comment

* update go.mod

Co-authored-by: cnderrauber <zengjie9004@gmail.com>
2022-01-08 18:54:23 +08:00
Raja Subramanian
ecf9590d56 More abstractions (#316) 2022-01-07 01:46:15 +05:30
Raja Subramanian
5064f35c29 Refactor media track subscriptions (#314)
* Refactor media track subscriptions

- To enable re-use of common bits
- Add max quality from other nodes

* Lock close handlers slice

* Reverting multiple on close handlers of downtrack, unclear if it is needed yet

* Make Logger a pointer

* audio level in MediaTrack like remote media track

* Cleanup

* Add a no subscribers callback

* Add method to update subscribed quality from another node

* loss proxying from remote node

* Address comments from David

* create subscriber node quality map
2022-01-06 09:02:11 +05:30
boks1971
973420faf5 Revert "Refactor media track subscriptions"
This reverts commit 9ca85454ed.
2022-01-04 16:57:49 +05:30
boks1971
9ca85454ed Refactor media track subscriptions
- To enable re-use of common bits
- Add max quality from other nodes
2022-01-04 16:40:47 +05:30
Raja Subramanian
995c1e8676 type aliases -> type definitions (#312)
* type alias -> type definition

* participantSid -> participantID in a comment

* Update protocol
2022-01-03 12:43:58 +05:30
Raja Subramanian
3a9009ae12 type definition of room name (#311)
* WIP commit

* update protocol

* Fixing a test and catching one place where casting was missed

* Fix one more spot which need conversion from livekit.RoomName -> string

* do not covert list
2022-01-02 16:49:16 +05:30
Raja Subramanian
07db1ba726 Some more files with types (#302) 2021-12-30 16:43:20 +05:30
Raja Subramanian
9d78619ca3 Catching a few more files with types (#299)
* Use types in mediatrack.go

* A bunch more files get types

* One more file
2021-12-29 23:51:06 +05:30
Raja Subramanian
ee99a323d2 Publisher controlled flex permissions (#284)
* WIP commit

* Add some tests

* allowedSubscribers uses participant sid

* correct variable name

* correct another variable name

* Add ParticipantSid to SubscriptionPermissionUpdate message

* protocol v0.11.2

* WIP commit

* WIP commit

* fix tests

* Remove unused code

* Close uptrack manager

* Remove duplicate close

* move comment to the correct line where the loop could be long

* Fix disallowed list revocation, thank you Jie

* Remove unneeded interface method

* RemoveSubscriber in Participant

* Clean up disallowed subscriptions and handle permissions on new track addition

* add test for track addition after permission set

* Remove unnecessary check
2021-12-24 14:14:40 +05:30