From 1116efcc34f8647347e5205a577e9148b122b3b3 Mon Sep 17 00:00:00 2001 From: Dan Minor Date: Mon, 22 Jun 2020 12:32:16 +0000 Subject: [PATCH] Bug 1646092 - Do not add ssrc-group to sdp on recvonly msections; r=bwc Chrome will not accept sdp with ssrc-group:FID on recvonly msections, causing calls to fail to be established between Firefox and Chrome when only a microphone is present on the Firefox side. Differential Revision: https://phabricator.services.mozilla.com/D80034 --- media/webrtc/signaling/gtest/jsep_session_unittest.cpp | 6 +----- media/webrtc/signaling/src/jsep/JsepTrack.cpp | 8 ++++++-- media/webrtc/signaling/src/jsep/JsepTrack.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/media/webrtc/signaling/gtest/jsep_session_unittest.cpp b/media/webrtc/signaling/gtest/jsep_session_unittest.cpp index cd3441abb4f8..572a449847db 100644 --- a/media/webrtc/signaling/gtest/jsep_session_unittest.cpp +++ b/media/webrtc/signaling/gtest/jsep_session_unittest.cpp @@ -3085,11 +3085,7 @@ TEST_F(JsepSessionTest, OfferAnswerRecvOnlyLines) { const auto& msection = parsedOffer->GetMediaSection(transceiver->GetLevel()); const auto& ssrcs = msection.GetAttributeList().GetSsrc().mSsrcs; - if (msection.GetMediaType() == SdpMediaSection::kVideo) { - ASSERT_EQ(2U, ssrcs.size()); - } else { - ASSERT_EQ(1U, ssrcs.size()); - } + ASSERT_EQ(1U, ssrcs.size()); } } diff --git a/media/webrtc/signaling/src/jsep/JsepTrack.cpp b/media/webrtc/signaling/src/jsep/JsepTrack.cpp index f085b7178064..b43cdba6ac28 100644 --- a/media/webrtc/signaling/src/jsep/JsepTrack.cpp +++ b/media/webrtc/signaling/src/jsep/JsepTrack.cpp @@ -256,8 +256,8 @@ bool JsepTrack::IsRtxEnabled( void JsepTrack::AddToMsection(const std::vector& constraintsList, sdp::Direction direction, - SsrcGenerator& ssrcGenerator, - bool requireRtxSsrcs, SdpMediaSection* msection) { + SsrcGenerator& ssrcGenerator, bool rtxEnabled, + SdpMediaSection* msection) { UniquePtr simulcast(new SdpSimulcastAttribute); UniquePtr rids(new SdpRidAttributeList); for (const JsConstraints& constraints : constraintsList) { @@ -283,6 +283,10 @@ void JsepTrack::AddToMsection(const std::vector& constraintsList, msection->GetAttributeList().SetAttribute(rids.release()); } + bool requireRtxSsrcs = + rtxEnabled && msection->GetDirectionAttribute().mValue != + SdpDirectionAttribute::Direction::kRecvonly; + if (mType != SdpMediaSection::kApplication && mDirection == sdp::kSend) { UpdateSsrcs(ssrcGenerator, constraintsList.size()); diff --git a/media/webrtc/signaling/src/jsep/JsepTrack.h b/media/webrtc/signaling/src/jsep/JsepTrack.h index 70985f294267..4b06236a5bd4 100644 --- a/media/webrtc/signaling/src/jsep/JsepTrack.h +++ b/media/webrtc/signaling/src/jsep/JsepTrack.h @@ -277,7 +277,7 @@ class JsepTrack { void AddToMsection(const std::vector& constraintsList, sdp::Direction direction, SsrcGenerator& ssrcGenerator, - bool requireRtxSsrcs, SdpMediaSection* msection); + bool rtxEnabled, SdpMediaSection* msection); // See Bug 1642419, this can be removed when all sites are working with RTX. void SetRtxIsAllowed(bool aRtxIsAllowed) { mRtxIsAllowed = aRtxIsAllowed; }