fix(SignalingLayer) Update SSRC owners on leave. (#2184)
* fix(SignalingLayer) Update SSRC owners on leave.
Update the SSRC owners in the following cases:
1. When a remote endpoint leaves the call.
2. When a source-remove is received.
3. When a source is remapped (with ssrc-rewriting enabled).
Create the remote track even if presence is not yet received. The ssrc owner check prevents the client from creating a dummy track when the call switches over from p2p to jvb when the last remote endpoint leaves the call.
* ref(SignalingLayer) alpha sort methods.
Clean up unused methods, _findEndpointSourceInfoForMediaType is not used anymore.
* squash: Address review comments.
fix(qualitycontrol): Cleanup old receiver constraints.
Endpoint based receiver constraints and other endpoint based bridge signaling messages are no longer supported by latest JVB after the switch to source-name signaling.
Rename method names 'sendNewReceiverVideoConstraintsMessage'->'sendReceiverVideoConstraintsMessage', 'setNewReceiverVideoConstraints'->'setReceiverVideoConstraints'
* ref: Inline onMucMemberLeft (has nothing to do with "moderator" and is broken).
* fix: Use isFocus instead of just reading the resource.
* ref: Inline onParticipantLeft.
* ref: Add _ to private function names.
* ref: Remove redundant function.
* ref: Initialize focusComponent once.
* ref: Remove two copies of "options".
* ref: Simplify the focusJid flow.
* ref: Rename focusCompoonent to targetJid.
* fix: Only retry on "invalid session" errors
We used to fire FOCUS_DISCONNECTED (which doesn't have anything to do
with anything disconnecting) and then retrying. This is not necessary
because FOCUS_DISCONNECTED is a fatal error and the client schedules
a reload of it's own (and we want the client reload as opposed to the
conference-request retry in case e.g. the shard has changed).
* ref: Remove use of visitorFocus.
* ref: Remove graceful shutdown handling (never used in backend).
* feat: Support conference request over HTTP.
* ref: eslint cleanup.
* fix: Add max timeout 2 minutes.
1. Checks peer's preferred codec in p2p case. Mobile and web have different preferred codecs.
2. Log an error message when the preferred codec is not offered by JVB.
3. Clean up code related to deprecated config.js settings 'preferH264' and 'disableH264'.
4. Refactor the codec selection logic so that correct codec is picked.
fix(TPC) Allow remote tracks to be created if no presence is found.
Currently, remote tracks are not created if presence for the endpoint is not received before source signaling. With ssrc-rewriting, the source information will be received on the bridge channel and presence on the prosody ws so there are chances that they can be out of sync. We do not want to skip remote track creation when that happens.
Remove support for legacy endpoint based signaling. (#2147)
* Remove support for legacy endpoint based signaling and make source-name signaling as the only signaling mode. The legacy screensharing mode will no longer be supported. The client will still be able to process remote presence sent in the old format to support interop with very old mobile clients and jigasi that do not support source-name signaling.
* remove code related to presenter mode.
Instead of Jicofo signaling all the remote sources available in the call, the bridge now signals only a limited set of SSRCs and then rewrites the SSRC on the outgoing media streams. The SSRC mapping is done based on the sources requested by the clients through the receiver constraints. This limits the number of m-lines in the remote/local SDPs on the client and therefore results in better performance in large calls.
* Handle source remapping messages from bridge
* Added track_owner_changed events
* don't process an invalid rtx ssrc.
* keep track of remote ssrcs, only renegotiate on new ones.
* Change source name on remote track on ssrc remapping.
* Don't remove tracks on member leave.
* Remove (orphaned) tracks on session terminated.
* Use serial number (per media type) to create msid attribute.
* Update videoType on remapping.
Co-authored-by: James A <jqdrqgnq@users.noreply.github.com>
fix(multi-stream) Block addition of multiple video streams of the same videoType.
This fixes an issue where mute camera operation doesn't stop sending camera stream even though locally it appears to the user that they are muted. This happens when multiple camera streams are added to peerconnection because of how toggle of the video button is implemented. This limitation will be removed when the application is fixed.
ref(RTC) Make the remove and add track method names more generic.
Since Track effects and mute/unmute operations use the same flow, i.e., removing/adding the track from the RTCPeerConnection but not from TPC, make the names of the methods involved more generic.
fix(RTC) Use mute/unmute track operation for effects.
Since the track is only temporarily removed and added back, it can be treated like mute & unmute operation. Fixes https://github.com/jitsi/lib-jitsi-meet/issues/2048. Remove a TODO thats no longer needed, track replace operation don't force renegotiations anymore.
fix(JitsiConference) log a warning instead of an error is p2p fails
In most cases it's not a real issue and it's still part of the logs,
throwing an unhandled exception at the global handler just prints an
ugly trackeback in the JS console which looks much worse than it really
is.
fix(multi-stream): Fix local SSRC cache to include multiple video streams. (#2006)
* fix(multi-stream): Fix local SSRC cache to include multiple video streams.
If multiple local video streams are found in the SDP, cache all of them instead of the first video SSRC. This fixes an issue where the resolution/fps stats for the screenshare track are not available.
* squash: new track inherits the source name of old track if it exists.
fix(multi-stream) Set the source name of replaced track before configuring it.
With just source-name enabled, set the source name of the replaced track before configuring the encodings, this fixes an issues where the sender constraints are not applied on the p2p connection because the source name is undefined.
fix(video-quality) Update frame heights in content-modify for p2p. (#1983)
* fix(video-quality) Update frame heights in content-modify for p2p.
When the user changes the preferred video quality settings from the UI, update the frame height values in content-modify for p2p connection when source-name signaling is enabled.
* fix(multi-stream) Send presence for desktop track before signaling when it is the first track to be added to the conference.
Also do not suppress renegotiation for desktop track on p2p since the browser doesn't fire negotiation needed event.
* squash: fix build
* squash: fix linter issues
* squash: add comment.
fix(conference) Disable p2p between eps running in different SDP modes.
Disable p2p between endpoints that are not running in the same SDP mode. The source-add/source-remove handlers assume the mids to follow the same pattern on both self and peer but the mids generated in plan-b mode are different from unified plan mode. Fixes https://github.com/jitsi/jitsi-meet/issues/11100.
* fix: Set affiliation.
XEP-0045:
Affiliations are granted, revoked, and maintained based on the user’s bare JID, not the nick as with roles.
* squash: Fixes own revokeOwner.
* Do not send analytics periodically.
* Stop sending e2eping after 5 responses (or 10 requests with no response).
* Pace requests based on conference size.
* Only send e2eping in one direction in a pair of endpoints.
fix(multi-stream-support) Support muting of desktop track.
* fix(multi-stream-support) Support muting of desktop track.
* fix(multi-stream) Always initiate responder renegotiation even for p2p.
This is needed since the new m-line is always added to the remote description.
* fix(multi-stream) Support multi-stream only on Unfied plan endpoints.
* fix(multi-stream) Advertise source-name signaling to Jicofo when supported.
* fix(JitsiLocalTrack): Remove unnecessary reject.
* fix: add the correct source name attribute for the second video track.
* squash: Address review comments.
feat(multi-stream-support) Add track streaming status (#1855)
* feat(multi-stream-support) Add TrackStreamingStatus class
update JitsiRemoteTrack to init and dispose TrackStreamingStatus
stop emitting LASTN_ENDPOINT_CHANGED event when source name signaling is enabled
convert TrackStreamingStatus class to typescript
* rename methods and use TrackStreamingStatus enum
* update jdocs for JitsiConferenceEvents.FORWARDED_SOURCES_CHANGED
feat(multi-stream-support) Adjust presence and videoType bridge message. (#1887)
* feat(multi-stream-support) Adjust presence and videoType message.
Adjust the sourceInfo for all the available local tracks. Do not add handlers for videoType changes on the peer since the videoType doesn't change when multiple stream support is enabled.
* fix(presence) Send the presence in old format for backwards compat.
Send the presence messages in both the old and new format when source name signaling is enabled and sending multiple streams is disabled.
* fix(JitsiConference) Send the videoType bridge msg after mute/unmute op is complete.
* ref(multi-stream-support) Throw if a track is being replaced with a track of different videoType.
This is not supported in the multi sender enabled mode.
* Address review comments.
feat(multi-stream-support) Configure the senders based on SenderVideoConstraintsV2.
The encodings for local video tracks are confiugured based on the SenderVideoConstraintsV2 constraints received from the bridge. The constraints are sourceName based. Also ignore enableLayerSuspension flag since it has been deprecated and layer suspension has been enabled by default. Also having it off makes screensharing on Chrome in unified plan not work as expected.