Skip to content

Commit

Permalink
Fix SDP constraints used by PeerConnectionWrapper
Browse files Browse the repository at this point in the history
The SDP constraints for publisher connections when the MCU is used were
set for all connections. Those constraints set "OfferToReceiveAudio" and
"OfferToReceiveVideo" to false, which disables receiving audio and video
when the local participant is the one sending the offer. Therefore,
audio and video was not received when the MCU was not used and the local
participant was the one initiating the connection.

The "OfferToReceiveXXX" configurations have no effect when set on an
answer (and thus are not even set, an empty MediaConstraints is used in
that case). However, when "OfferToReceiveVideo = false" is set the video
transceiver is explicitly stopped (which is used to avoid receiving
video when joining a call with audio only). Therefore, as
"OfferToReceiveVideo = false" was always set, video was never received
in subscriber connections when the MCU is used, or connections initiated
by the other peer when the MCU is not used.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
  • Loading branch information
danxuliu authored and backportbot[bot] committed Jan 3, 2025
1 parent 94fba1f commit 7287a45
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2350,18 +2350,22 @@ class CallActivity : CallBaseActivity() {
sessionId: String?,
type: String
): PeerConnectionWrapper {
val tempSdpConstraints: MediaConstraints?
val tempIsMCUPublisher: Boolean
val tempHasMCU: Boolean
val tempLocalStream: MediaStream?
if (hasMCU && publisher) {
tempSdpConstraints = sdpConstraintsForMCUPublisher
tempIsMCUPublisher = true
tempHasMCU = true
tempLocalStream = localStream
} else if (hasMCU) {
tempSdpConstraints = sdpConstraints
tempIsMCUPublisher = false
tempHasMCU = true
tempLocalStream = null
} else {
tempSdpConstraints = sdpConstraints
tempIsMCUPublisher = false
tempHasMCU = false
tempLocalStream = if ("screen" != type) {
Expand All @@ -2374,7 +2378,7 @@ class CallActivity : CallBaseActivity() {
return PeerConnectionWrapper(
peerConnectionFactory,
iceServers,
sdpConstraintsForMCUPublisher,
tempSdpConstraints,
sessionId,
callSession,
tempLocalStream,
Expand Down

0 comments on commit 7287a45

Please sign in to comment.