File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed
src/main/java/org/jitsi/videobridge Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 113113 <dependency >
114114 <groupId >${project.groupId} </groupId >
115115 <artifactId >jitsi-media-transform</artifactId >
116- <version >1.0-139-g33e0a49 </version >
116+ <version >1.0-142-g94e1c26 </version >
117117 </dependency >
118118 <dependency >
119119 <groupId >${project.groupId} </groupId >
Original file line number Diff line number Diff line change @@ -1463,6 +1463,27 @@ public void updateAcceptedMediaTypes()
14631463 this .acceptVideo = acceptVideo ;
14641464 }
14651465
1466+ public void updateForceMute ()
1467+ {
1468+ boolean audioForcedMuted = false ;
1469+ for (ChannelShim channelShim : channelShims )
1470+ {
1471+ if (!channelShim .allowIncomingMedia ())
1472+ {
1473+ switch (channelShim .getMediaType ())
1474+ {
1475+ case AUDIO :
1476+ audioForcedMuted = true ;
1477+ break ;
1478+ case VIDEO :
1479+ logger .warn (() -> "Tried to mute the incoming video stream, but that is not currently supported" );
1480+ break ;
1481+ }
1482+ }
1483+ }
1484+ transceiver .forceMuteAudio (audioForcedMuted );
1485+ }
1486+
14661487 /**
14671488 * @return this {@link Endpoint}'s transceiver.
14681489 */
Original file line number Diff line number Diff line change @@ -382,6 +382,19 @@ public boolean allowsSendingMedia()
382382 "sendonly" .equalsIgnoreCase (direction );
383383 }
384384
385+ /**
386+ * Checks if incoming media (from the endpoint to the bridge) is being
387+ * forcibly "muted"
388+ * @return true if media for this channel is allowed, false if it should
389+ * be forcibly "muted" (dropped)
390+ */
391+ public boolean allowIncomingMedia ()
392+ {
393+ return "sendrecv" .equalsIgnoreCase (direction ) ||
394+ "recvonly" .equalsIgnoreCase (direction );
395+
396+ }
397+
385398 /**
386399 * Sets the media direction of this channel.
387400 * @param direction the direction to set.
@@ -392,6 +405,7 @@ public void setDirection(String direction)
392405 {
393406 this .direction = direction ;
394407 this .endpoint .updateAcceptedMediaTypes ();
408+ this .endpoint .updateForceMute ();
395409 }
396410 }
397411
You can’t perform that action at this time.
0 commit comments