Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitor visitors' codec lists, and aggregate them into a conference property. #1137

Merged
merged 11 commits into from
Feb 27, 2024

Conversation

JonathanLennox
Copy link
Member

@JonathanLennox JonathanLennox commented Feb 23, 2024

{
visitorCount.adjustValue(-1);
if (codecs != null) {
visitorCodecs.removePreference(codecs);
Copy link
Member

@bgrozev bgrozev Feb 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We allow codecs to change from null to a non-null, so if a visitor joins with no codecs and then adds some it would mess with the count. It's a bit of a stretch, but one could trick jicofo into upgrading to av1 thus breaking video for some participants.
Maybe make ChatRoomMemberImpl.videoCodecs a lazy val and initialize it with the first presence received?

Unless I misunderstand how the aggregator works

fun removePreference(prefs: List<String>) {
synchronized(lock) {
count--
check(count >= 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be force to fail by sending initial presence with no codecs, then updating with some codecs, then leaving repeatedly

} ?: // Older clients sent a single codec in codecType rather than all supported ones in codecList
presence.getExtensionElement("jitsi_participant_codecType", "jabber:client")?.let {
if (it is StandardExtensionElement) {
videoCodecs = if (it.text == "vp8") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In JitsiParticipantCodecList.kt you use lowercase(). Is it also required here?

bgrozev
bgrozev previously approved these changes Feb 27, 2024
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 54.09836% with 56 lines in your changes are missing coverage. Please review.

Project coverage is 29.41%. Comparing base (be8a115) to head (c48563d).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1137      +/-   ##
============================================
+ Coverage     28.73%   29.41%   +0.68%     
- Complexity      467      485      +18     
============================================
  Files           129      130       +1     
  Lines          7747     7863     +116     
  Branches       1059     1081      +22     
============================================
+ Hits           2226     2313      +87     
- Misses         5254     5277      +23     
- Partials        267      273       +6     
Files Coverage Δ
...ofo/src/main/kotlin/org/jitsi/jicofo/xmpp/Smack.kt 100.00% <100.00%> (ø)
...tsi/jicofo/conference/JitsiMeetConferenceImpl.java 44.40% <18.18%> (+0.96%) ⬆️
...tlin/org/jitsi/jicofo/util/PreferenceAggregator.kt 75.00% <75.00%> (ø)
...in/org/jitsi/jicofo/xmpp/muc/ChatRoomMemberImpl.kt 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be8a115...c48563d. Read the comment docs.

bgrozev
bgrozev previously approved these changes Feb 27, 2024
@JonathanLennox JonathanLennox merged commit 49cc46e into jitsi:master Feb 27, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants