fix(TPCUtils): Chain both RTCRtpSender getParameters and setParameters call properly.
Firefox 123 started throwing an error when the transction ids for getParamters and setParameters don't match. This can result in Firefox not establishing a p2p connection with a remote peer when it is the offerer.
fix(video-quality): Adjust encodings bitrates/scalefactor for high capture resolutions (#2436)
* fix(video-quality): Adjust encodings bitrates/scalefactor for high capture resolutions.
When the client is configured to capture camera sources at 1080p or higher, adjust the bitrates and the encodings scale factor accordingly.
* squash: Address review comments
Fix the bitrates set on the remote description and also bump up the bitrates for 1080p, 4k and screenshare.
* squash: Address some more review comments.
fix(video-quality): Remove the encoding check for webkit.
This check is not needed anymore since we now set the correct scaleResolutionDownBy value everytime the encodings are configured. Fixes a regression on Safari where it can end up sending low resolution to a p2p peer in some cases. Also, add more unit tests for p2p desktop share cases.
* fix(RTC): Remove support for plan-b SDP.
Since unified plan mode becomes the default mode, so does multi-stream mode.
* squash: Remove plan-b unit tests and fix comments
* squash: address review comments
fix(TPC): Do not configure 'scaleResolutionDownBy' and 'maxBitrate' for legacy VP9 K-SVC.
When these are configured, the browser sends only the lowest resolution layer even when all the encodings are active. Fixes a quality issue on older versions of Chromium that do not support the scalabilityMode API.
fix(TPCUtils) Insert simulcast recv line for all senders on FF.
The simulcast receive lines needs to be inserted in the receive desc for all the m-line associated with local tracks, currently its being done only for the first video source.
Add SVC and Simulcast support for AV1 and VP9. (#2350)
Add SVC and Simulcast support for AV1 and VP9.
The default mode is the full SVC mode for VP9. It works as expected with the current version of JVB.
AV1 in the client is only supported when the bridge negotiates the Dependency Descriptor extension headers which are needed for reading the layer information for AV1 and H.264 video frames.
* feat: Enable H.264 simulcast support.
Multi-encoding simulcast for H.264 is supported now because of the DD header ext support added on the bridge side.
* fix(video-quality): Add default bitrates for all codecs.
Expect the videoQuality settings in the new format, deprecated configs are still supported.
videoQuality: {
AV1: {
maxBitratesVideo: {
low: 100000,
standard: 300000,
high: 1000000,
ssHigh: 1500000
},
useScalabilityModeAPI: {
enabled: true,
useSimulcast: true, //(defaults to SVC),
useKSVC: true //(defaults to L3T3_KEY)
},
},
H264: {
maxBitratesVideo: {
low: 200000,
standard: 500000,
high: 1500000,
ssHigh: 2500000
}
},
VP8: {
maxBitratesVideo: {
low: 200000,
standard: 500000,
high: 1500000,
ssHigh: 2500000
}
},
VP9: {
maxBitratesVideo: {
low: 100000,
standard: 300000,
high: 1200000,
ssHigh: 2500000
},
useScalabilityModeAPI: {
enabled: true,
useSimulcast: true, //(defaults to SVC),
useKSVC: true //(defaults to L3T3_KEY)
},
}
}
* Disable encodings when requested height for screenshare is 0.
* feat: add unit tests for scalability modes.
* ref: Move all encoding configuration calculation to TPCUtils.
* Add more unit tests for VP9 K-SVC mode.
* Make codec name in settings case insensitive.
Also read the deprecated max bitrates correctly, add unit tests to test it.
* ref(TPC): isSimulcastOn -> isSpatialScalabilityOn.
It makes more sense to call it spatial scalability than simulcast now that full SVC support is available.
* fix: Negotiate AV1 DD header exts only for AV1 and H.264.
* fix: Rename setting useL3T3Mode->useKSVC and adjust the defaults.
fix(TPC): Revert the reverse ordering of encodings for Firefox 117 and newer.
In the older versions, the SSRCs in the SDP were in reversed order, i.e., the resolution order was 1:2:4 as opposed to Chromium and other browsers. Therefore, the client was confuguring the reverse order. However, the commit https://hg.mozilla.org/mozilla-central/rev/b0348f1f8d7197fb87158ba74542d28d46133997 which was seems to have landed in Firefox 117 has reverted the reversing of the RID order. Therefore, this hack is no longer needed on the newer Firefox versions.
This fixes an issue where the bridge suspends all video from Firefox to other endpoints in the call because of the reversed order of the encodings.
fix(JingleSession) Modify encoding to stop/start outgoing media on p2p.
This is much faster than changing direction on the transceiver and doesn't need a renegotiation for the suspending/resuming media. Also fixes an issue with audio-only mode in p2p where media doesn't resume when audio-only mode is disabled if it was enabled while the jvb connection was active.
Revert "Adjusted wrapping method to have RTCRtpSender setting parameters in sequential manner in order to solve race condition when transaction id can be reset at the end of videoSender setParameters and cause exception if another update was already in fly and before its check for transaction id presence."
This reverts commit 17ade96a70.
It causes setParameters failures which can cause media being leaved to
JVB when in a P2P connection.
fix(JingleSession) Reconfigure the stream encodings after p2p->jvb switch.
Fixes blurry screenshare in some cases. There is a higher probability of the higher layers getting suspended when all the stream encodings are enabled for low fps SS. Make sure only the highest spatial layer is sent for low fps SS after p2p->jvb switch. Make sure all the stream encodings are enabled for high fps SS after p2p->jvb switch.
Adjusted wrapping method to have RTCRtpSender setting parameters in sequential manner in order to solve race condition when transaction id can be reset at the end of videoSender setParameters and cause exception if another update was already in fly and before its check for transaction id presence.
fix(TPC) Avoid applying constraints on desktop tracks if not needed. (#2246)
* fix(TPC) Avoid applying constraints on desktop tracks if not needed.
Ignore sender constraints if the client is already sending video of the requested resolution. For desktop tracks, max resolution will be the height of the window being captured irrespective of the height being requested by the peer. Therfore, check if the configured resolution is equal to the track height for all requested heights > 0.
Fixes an issue where the track addition fails because of setParameters failing on the video track. This is only seen the torture tests because this is very timing specific.
* squash: check correct scaleResolutionDownBy value for p2p conn.
fix(TPC) Disable media instead of changing dir for p2p->jvb switch. (#2226)
* fix(TPC) Disable media instead of changing dir for p2p->jvb switch.
Resume or suspend the media on the jvb peerconnection by changing the RTCRtpEncodingParamters.active state instead of changing the direction on the transceiver. This avoids the needs to start a O/A renegotiation cycle for these operations. The media direction will be changed only for p2p lastn=0 case since video needs to be disabled on both the sender and the peer for p2p lastn=0 case.
* Address review comments
* Disable media after adding source while media is suspended on the jvb connection. Default 'active' state for stream encodings after the source is added is 'true'.
* Wait for all the promises to be settled before returning
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.
Adds a helper function getSourceIndexFromSourceName to
have track index parsing in one place.
In _processLocalSSRCsMap there was an assumption that a track
index can be a single digit only.
Use "last index of" or search from the end of the collection to
make parsing a bit more universal (does not matter as much for
Jitsi endpoint IDs, but if fixes issues if someone has
a customization there).
fix(TPC): Ignore stopped transceivers on FF during new track addition.
Firefox lists stopped transceivers when getTranceivers is called, ignore these when picking a trancceiver for a screenshare track. Fixes an issue when starting screenshare fails if there are stopped tranceivers in the peerconnection (i.e., if some remote users with sources have left the call).
fix(multi-stream) Fix VP9 bitrates in the multi-stream mode.
Set the bitrates on the video m-lines based on the associated track type. In multi-stream mode, there will be two separate m-lines for camera and desktop tracks. Also fallback to SDP munging for setting codec preferences on Chromium.
fix(multi-stream) fix p2p issues with secondary video sources.
* fix(multi-stream) add new m-line when remote adds a second video source in p2p.
A new m-line needs to be added in the remote description when a new secondary video source is signaled by the peer.
* fix(TPC) Suppress lower layers only for screenshare tracks.
With multi-stream support enabled, an extra check for videoType for local track is needed to dtermine if the lower layers need to be suppressed.
* fix(TPC) Mark the direction inactive on inactive media connection.
If a new secondary video source is added on the jvb connection while p2p is active, make sure the direction is set to inactive on the jvb connection, so that no media is being sent out on the jvb connection.
* squash: Address review comments.
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 the support for multiple local video streams.
* feat(multi-stream-support) Add the support for multiple local video streams.
This feature is behind 'sendMultipleVideoStreams' config.js flag and is currently supported only on clients running in Unified plan mode.
* squash: Use the track index from source name to find the matching transceiver on unmute.
* ref(TPC) Configure encodings in one go.
Configure the active state, maxBitrate and degradation preference in one go instead of configuring them separately.
* squash: Address review comments.
* squash: fix a comment.
fix: Missed SSRCs in Unified Plan with several "ssrc-group:FID" groups. (#1658)
* fix: Missed SSRCs in Unified Plan with several "ssrc-group:FID" groups.
`TpcUtils.ensureCorrectOrderOfSsrcs()` takes into account only the first `ssrs-group`, and it causes missed `ssrs` attributes. It results in an error during `peerconnection.setRemoteDescription()`.
For fixing `ensureCorrectOrderOfSsrcs()`, all `ssrs-group` are traversed and all distinct `ssrs` are preserved with keeping their order.
* test: Added extra tests for `TpcUtils.ensureCorrectOrderOfSsrcs()`