Skip to content

Commit

Permalink
Fix wantsStatsFrom, by fixing isRankedSpeaker. (#1803)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanLennox authored Jan 26, 2022
1 parent d7470af commit a8b39c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 1 addition & 2 deletions jvb/src/main/java/org/jitsi/videobridge/Conference.java
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,7 @@ public boolean isRankedSpeaker(AbstractEndpoint ep)
{
return false;
}
DominantSpeakerIdentification<String>.SpeakerRanking ranking = speechActivity.getRanking(ep.getId());
return ranking.energyRanking < LoudestConfig.Companion.getNumLoudest();
return speechActivity.isAmongLoudest(ep.getId());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ public DominantSpeakerIdentification<String>.SpeakerRanking getRanking(String en
return dominantSpeakerIdentification.getRanking(endpointId);
}

public boolean isAmongLoudest(String endpointId)
{
return dominantSpeakerIdentification.isAmongLoudest(endpointId);
}

/**
* Notifies this instance that a new audio level was received or measured by an <tt>Endpoint</tt>.
*
Expand Down
7 changes: 7 additions & 0 deletions jvb/src/main/kotlin/org/jitsi/videobridge/Endpoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,13 @@ class Endpoint @JvmOverloads constructor(
* Determine whether to forward endpoint stats from another endpoint to this one.
*/
fun wantsStatsFrom(ep: AbstractEndpoint): Boolean {
logger.debug {
"wantsStatsFrom(${ep.id}): isRecentSpeaker=${conference.speechActivity.isRecentSpeaker(ep)} " +
"isRankedSpeaker=${conference.isRankedSpeaker(ep)} " +
"isOnStageOrSelected=${bitrateController.isOnStageOrSelected(ep)} " +
"hasNonZeroEffectiveConstraints=${bitrateController.hasNonZeroEffectiveConstraints(ep)}"
}

return conference.speechActivity.isRecentSpeaker(ep) ||
conference.isRankedSpeaker(ep) ||
bitrateController.isOnStageOrSelected(ep) ||
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<kotest.version>4.6.3</kotest.version>
<junit.version>5.8.1</junit.version>
<jicoco.version>1.1-101-g2170967</jicoco.version>
<jitsi.utils.version>1.0-109-g31bfa99</jitsi.utils.version>
<jitsi.utils.version>1.0-110-g9d958b7</jitsi.utils.version>
<ktlint-maven-plugin.version>1.11.0</ktlint-maven-plugin.version>
<maven-shade-plugin.version>3.2.2</maven-shade-plugin.version>
<spotbugs.version>4.5.0</spotbugs.version>
Expand Down

0 comments on commit a8b39c3

Please sign in to comment.