Commit Graph

794 Commits

Author SHA1 Message Date
Benjamin Pracht be018f97b6 Provide the InputVideo/AudioState to Ingress in WHIPRTCConnectionNotify (#3982) 2025-10-06 14:16:35 -07:00
Benjamin Pracht 146bd9699d Do not panic of redis is not configured (#3981) 2025-10-06 07:47:29 -07:00
Raja Subramanian 3bd20ddb28 Revert unintentional change to not handle transport fallback on (#3970)
publisher peer connection.

While cleaning up during single peer connection changes, unintentionally
removed handler.

Also, another small change to log first packet time adjustment after
increment.
2025-09-30 10:24:26 +05:30
Paul Wells 060719d17d add config for user data recording (#3966)
* add config for user data recording

* missing file

* wire

* deps
2025-09-29 14:01:39 -07:00
Paul Wells 3d73703152 add idempotent reference count to telemetry stats worker (#3964)
* add idempotent reference guard to telemetry stats worker

* tidy

* sync

* tidy
2025-09-29 02:35:16 -07:00
Anunay Maheshwari 990c5fafbb feat: server rpc apis (#3904)
* feat: server rpc apis

* fix: cleanup

* fix: move rpc impl to participant

* cleanup

* cleanup, psrpc errors

* remove TODO comment

* update protocol, handle participant disconnect case

* add ephemeral participant identity to rpc data packet

* fix: panic

* chore(deps): bump proto
2025-09-24 13:16:27 +05:30
Paul Wells 56ee23282f handle terminated job requests (#3948) 2025-09-23 23:54:01 -07:00
cnderrauber f4a06cf025 Clean code as there is no oss sweeper for ingress (#3918) 2025-09-11 16:44:52 +08:00
David Zhao 5f561b4ff1 Include agent_name as a participant attribute (#3914) 2025-09-10 21:29:55 -07:00
Paul Wells 782a35e801 update protocol for psrpc (#3915) 2025-09-10 21:01:28 -07:00
cnderrauber 76645fad5e Rpcs for ingress proxy WHIP (#3911)
See https://github.com/livekit/protocol/pull/1194
2025-09-09 22:49:42 +08:00
Raja Subramanian 991a4a4f53 Refactor subscribedTrack + mediaTrackSubscriptions. (#3908)
- Move downTrack instantiation to SubscribedTrack as it should own that
  DownTrack. Still more to do here as `DownTrack` is fetched from
  `SubscribedTrack` in a few places and used. Would like to avoid that,
  but doing this initially.
- Use an interface from sfu.Downtrack and replace a bunch of callbacks.
  SubscribedTrack is the implementation for DownTrackListener.
2025-09-08 18:20:19 +05:30
Raja Subramanian e16b3ba95a Use gzip reader pool (#3903)
Borrowing from @paulwe's change for internal proto
2025-09-07 13:50:22 +05:30
Paul Wells 17c349210d update protocol for sip api change (#3902) 2025-09-06 12:00:22 -07:00
Raja Subramanian 07c40cf349 Use RequestResponse to report protocol handling errors (#3895)
* Send errors as necessary

* WIP

* WIP

* WIP

* WIP

* deps

* static check

* fix test

* test

* test

* logs
2025-09-04 11:27:07 +05:30
Raja Subramanian 6633bf9372 Use departure timeout from room preset. (#3888)
Not sure why only that was applying from req which is effectively a
no-op as the clone is a replica of the req. Guess, it was a typo/miss.
Change it to use room preset config value.
2025-08-29 22:22:32 +05:30
Paul Wells 2aeadf14dc init ua parser once (#3883) 2025-08-28 05:20:25 -07:00
Raja Subramanian 890fd94249 Single peer connection mode (#3873)
* WIP

* check using protocol version

* revert

* clean up

* sdp cid argument

* WIP

* WIP

* test

* clean up

* clean up

* fixes

* clean up

* clean up

* clean up

* conditional checks

* tests for both dual and single peer connection

* test

* test

* test

* type check

* test

* todo

* munges

* combined config

* populate mid

* limit to receive only

* clean up

* clean up

* clean up

* older test

* clean up

* alternative audio codec

* dtx

* don't need to copy

* Anunay feedback

* use the available peer connection

* publisher check

* WIP

* WIP

* WIP

* no mid

* media sections requirement

* mage generate

* WIP

* WIP

* set data channel receive size for test

* handle early media better

* WIP

* do not do ICERestart if no subscriber

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* start up subscriber RTCP worker

* WIP

* WIP

* clean up

* clean up

* flag to indicate use of single peer connection

* remove unused interface method

* clean up

* clean up

* Jie feedback #1

* deps

* do not access subscriber in one shot mode

* more places for one shot mode

* more one shot fixes

* deps

* deps

* test
2025-08-28 12:16:18 +05:30
David Zhao bfe98eaa09 fix: ensure the participant kind is set on refresh tokens (#3881) 2025-08-26 10:25:25 -07:00
Benjamin Pracht dc3a775350 Fix timeout handing in StopEgress (#3876) 2025-08-25 10:34:26 -07:00
Raja Subramanian b182d07bac Log signal messages as debug. (#3851) 2025-08-14 16:17:45 +05:30
Raja Subramanian fa5f4ef33c Populate SDP cid in track info when available. (#3845)
* Populate SDP cid in track info when available.

- Adding SDP cid to TrackInfo. Browsers like FF uses a different stream
  id for AddTrack and actual SDP offer. So, have to look up using both
  on server side. To make it easier, store both (only if different) in
  TrackInfo.
- Use a codec in TrackInfo for audio also. There is some discussion
  around doing simulcast codec for audio so that something like PSTN can
  use G.711 without any transcoding. So, just keep it consistent between
  audio and video.
- Populate SDP cid when SDP offer is received. It could populate a
  pending track or an already published track if the new offer is for a
  back up codec where the primary codec is already published.
- Passed around parsed offer to more places to avoid parsing multiple
  times.
- Clean up MediaTrack interface a bit and remove unneeded methods.

* WIP

* WIP

* deps

* stream allocator mime aware

* clean up

* populate SDP cid before munging

* interface methods
2025-08-13 10:53:16 +05:30
Raja Subramanian f275f592ed handle SyncState in join request (#3839)
* handle SyncState in join request

* check for nil in function
2025-08-08 10:14:02 +05:30
Raja Subramanian 5d44cf6d57 Use wrapped join request to be able to support compressed and uncompressed. (#3838)
* Do no gzip join request

* wrapped join request

* deps
2025-08-07 22:37:08 +05:30
Raja Subramanian 5ca1626439 Support join request as proto + base64 encoded query param (#3836)
* Support join request as proto + base64 encoded query param

* joinPublish

* staticcheck

* deps

* tests

* gzip

* test

* deps

* clean up
2025-08-07 11:13:27 +05:30
Raja Subramanian 7dea101286 Clean up missed v2 pieces (#3837)
* Clean up missed v2 pieces

* missed stuff
2025-08-06 22:30:50 +05:30
Raja Subramanian 34a491309f Delete v2 signalling (#3835)
* Delete v2 signalling

* deps

* mage generate

* deelte unused file
2025-08-06 09:08:09 +05:30
Nishad 1fe337160a Fix: RingingTimeout was being skipped for transferParticipant (#3831)
We weren't relaying the RingingTimeout for transferSipParticipant. This fixes that
2025-08-04 02:39:58 -07:00
Raja Subramanian 5751692a2f deps (#3829) 2025-08-03 04:00:38 +05:30
Raja Subramanian db4bc127e8 Get to the point of connecting publisher PC and using it for async signalling (#3822)
* starting signalling DC work

* WIP

* plumbing data channel

* add datachannel message sink file

* mage generate

* clean up
2025-08-01 18:50:28 +05:30
Raja Subramanian e3155b146b Get to the point of establishing subscriber peer connection. (#3821)
Proper message id checks.

Some refactoring for common code in rtcv2service handlers.

Instantiate signalling based on synchronous local candidates flag, but
needs better defined code.
2025-07-25 14:49:04 +05:30
Raja Subramanian a7ce138239 HTTP DELETE of participant session (#3819) 2025-07-24 23:02:45 +05:30
Raja Subramanian 68387b41fe Minor tweak to keep RPC type at service level. (#3815) 2025-07-24 11:30:00 +05:30
Raja Subramanian a75295fcd5 More v2 signalling changes (#3814)
* More v2 signalling changes

- Use wire message in relay signal
- Generate offerId for SDP for sync mode also
- more checks for SDP offer/answer state to see if there are cases of
  missed/duplicate messages

* clean up
2025-07-24 10:14:01 +05:30
Raja Subramanian b20db94dc9 Validation end point for v2 signalling. (#3811)
* WIP

* stricter check

* WIP

* WIP

* clean up
2025-07-23 11:59:30 +05:30
Raja Subramanian 0a1bfd3092 Signal handling interfaces and participant specific HTTP PATCH. (#3804)
* HTTP PATCH on participant sid

* rename

* signal handler

* new files

* clean up

* clean up reassembly

* handle messages on server side

* deps

* staticcheck

* clean up
2025-07-20 22:47:36 +05:30
Raja Subramanian 7837c8e595 starting signaller interface (#3802)
* starting signaller interface

* WIP

* WIP

* WIP

* typo

* connect response check

* WIP

* clean up

* move signal handling to participant fully

* service methods

* type assertions for interfaces
2025-07-20 13:48:40 +05:30
Benjamin Pracht 18ce524455 Handle Metadata field from RoomConfig (#3798) 2025-07-18 10:37:23 -07:00
Raja Subramanian 078c01fad3 Signal v2: envelope and fragments as wire message format. (#3800)
* Signal v2: envelope and fragments as wire message format.

Please see details in https://github.com/livekit/protocol/pull/1133

* log connect response
2025-07-18 15:24:32 +05:30
Raja Subramanian b9a44c3fbf Signalling V2 protocol implementation start (#3794)
* WIP

* name

* refactor validate

* WIP

* WIP

* signal cache initial impl

* HandleConnect in room manager

* generate subscriber offer

* handle ConnectRequest as stand alone

* segmentation, reassembly

* clean up

* rearrange

* lock scope

* support metadata in connect request

* prom

* add SifTrailer to ConnectResponse

* prom for get offer error counter

* RtcInit counter

* Jie feedback

* signal client

* consolidate v1 and v2 into SignalClient

* clean up

* comment

* deps

* mage generate

* fix tests

* pass around roomName and participantIdentity

* mage generate
2025-07-18 00:01:21 +05:30
Benjamin Pracht 1f31d430b0 Map ErrNoResponse to ErrRequestTimedOut in StopEgress to avoid returning 503 (#3788) 2025-07-14 13:30:24 -07:00
Raja Subramanian 01bf96855d SVC with RID -> spatial layer mapping (#3754)
* SVC with RID -> spatial layer mapping

There are cases where an SVC track comes in with a RID.
As there is no RID announced in SDP, it maps to invalid layer.
Seems to happen with older browsers.

* test
2025-06-23 12:45:13 -07:00
David Colburn e467daa0d4 move egress roomID load to launcher (#3748)
* move egress roomID load to launcher

* regenerate
2025-06-20 16:22:19 -04:00
Raja Subramanian 9d569e2fef Take ClientInfo from request. (#3738)
This will allow WHIP client to pass in client info which can provide
more information about WHIP clients for telemetry.
2025-06-16 21:01:15 -07:00
Raja Subramanian a9e2911645 Add Id to SDP signalling messages. (#3722)
* Add Id to SDP signalling messages.

Allows matching up offer/answer.
For now, the subscriber answer just logs if there is a mismatch.

* correct variable name

* test

* fixing rid

* revert

* clean up
2025-06-12 14:39:25 -07:00
Raja Subramanian e98fb94fd2 Create client config manager in room manager constructor. (#3718)
* Create client config manager in room manager constructor.

Remove it from wire to be consistent with cloud which does hot reload.

* disable advanced codecs on iOS when using JS SDK
2025-06-10 21:06:49 -07:00
cnderrauber fdf9b85290 e2e reliability for data channel (#3716)
* e2e reliability for data channel

* solve comments
2025-06-11 11:14:30 +08:00
Raja Subramanian 1d9a43667a Do not require create permission for WHIP participant. (#3715) 2025-06-09 22:19:00 -07:00
Paul Wells 630aa7d970 implement observability for room metrics (#3712)
* implement observability for room metrics

* deps

* test

* test

* Raja feedback

* cleanup
2025-06-09 09:32:58 -07:00
Paul Wells e7f0294e3f remove unused ws signal read loop (#3709)
* remove unused ws signal read loop

fixes #3708

* tidy
2025-06-08 20:07:55 -07:00