diff --git a/media/webrtc/signaling/src/jsep/JsepSession.h b/media/webrtc/signaling/src/jsep/JsepSession.h index b1cea73facfe..2703dd16443e 100644 --- a/media/webrtc/signaling/src/jsep/JsepSession.h +++ b/media/webrtc/signaling/src/jsep/JsepSession.h @@ -207,10 +207,16 @@ class JsepSession { } } + // See Bug 1642419, this can be removed when all sites are working with RTX. + void SetRtxIsAllowed(bool aRtxIsAllowed) { mRtxIsAllowed = aRtxIsAllowed; } + protected: const std::string mName; JsepSignalingState mState; uint32_t mNegotiations; + + // See Bug 1642419, this can be removed when all sites are working with RTX. + bool mRtxIsAllowed = true; }; } // namespace mozilla diff --git a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp index f96e4f3cd1bc..7be8789b69fa 100644 --- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp +++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp @@ -407,7 +407,8 @@ std::vector JsepSessionImpl::GetRtpExtensions( AddVideoRtpExtension(webrtc::RtpExtension::kRtpStreamIdUri, SdpDirectionAttribute::kSendonly); - if (Preferences::GetBool("media.peerconnection.video.use_rtx", false)) { + if (mRtxIsAllowed && + Preferences::GetBool("media.peerconnection.video.use_rtx", false)) { AddVideoRtpExtension(webrtc::RtpExtension::kRepairedRtpStreamIdUri, SdpDirectionAttribute::kSendonly); } @@ -1949,6 +1950,7 @@ void JsepSessionImpl::SetupDefaultCodecs() { new JsepAudioCodecDescription("101", "telephone-event", 8000, 1)); bool useRtx = + mRtxIsAllowed && Preferences::GetBool("media.peerconnection.video.use_rtx", false); // Supported video codecs. // Note: order here implies priority for building offers! diff --git a/media/webrtc/signaling/src/jsep/JsepTrack.cpp b/media/webrtc/signaling/src/jsep/JsepTrack.cpp index 0328703ddeb8..f085b7178064 100644 --- a/media/webrtc/signaling/src/jsep/JsepTrack.cpp +++ b/media/webrtc/signaling/src/jsep/JsepTrack.cpp @@ -451,6 +451,7 @@ std::vector> JsepTrack::NegotiateCodecs( JsepVideoCodecDescription* cloneVideoCodec = static_cast(clone.get()); bool useRtx = + mRtxIsAllowed && Preferences::GetBool("media.peerconnection.video.use_rtx", false); videoCodec->mRtxEnabled = useRtx && cloneVideoCodec->mRtxEnabled; videoCodec->mRtxPayloadType = cloneVideoCodec->mRtxPayloadType; diff --git a/media/webrtc/signaling/src/jsep/JsepTrack.h b/media/webrtc/signaling/src/jsep/JsepTrack.h index d091b164ec8d..70985f294267 100644 --- a/media/webrtc/signaling/src/jsep/JsepTrack.h +++ b/media/webrtc/signaling/src/jsep/JsepTrack.h @@ -198,7 +198,8 @@ class JsepTrack { virtual std::vector GetRtxSsrcs() const { std::vector result; - if (Preferences::GetBool("media.peerconnection.video.use_rtx", false)) { + if (mRtxIsAllowed && + Preferences::GetBool("media.peerconnection.video.use_rtx", false)) { std::for_each( mSsrcToRtxSsrc.begin(), mSsrcToRtxSsrc.end(), [&result](const auto& pair) { result.push_back(pair.second); }); @@ -278,6 +279,9 @@ class JsepTrack { sdp::Direction direction, SsrcGenerator& ssrcGenerator, bool requireRtxSsrcs, SdpMediaSection* msection); + // See Bug 1642419, this can be removed when all sites are working with RTX. + void SetRtxIsAllowed(bool aRtxIsAllowed) { mRtxIsAllowed = aRtxIsAllowed; } + private: std::vector> GetCodecClones() const; static void EnsureNoDuplicatePayloadTypes( @@ -325,6 +329,9 @@ class JsepTrack { std::map mSsrcToRtxSsrc; bool mActive; bool mRemoteSetSendBit; + + // See Bug 1642419, this can be removed when all sites are working with RTX. + bool mRtxIsAllowed = true; }; } // namespace mozilla diff --git a/media/webrtc/signaling/src/jsep/JsepTransceiver.h b/media/webrtc/signaling/src/jsep/JsepTransceiver.h index 9d82d1b41f78..fac6b3237546 100644 --- a/media/webrtc/signaling/src/jsep/JsepTransceiver.h +++ b/media/webrtc/signaling/src/jsep/JsepTransceiver.h @@ -177,6 +177,12 @@ class JsepTransceiver { return false; } + // See Bug 1642419, this can be removed when all sites are working with RTX. + void SetRtxIsAllowed(bool aRtxIsAllowed) { + mSendTrack.SetRtxIsAllowed(aRtxIsAllowed); + mRecvTrack.SetRtxIsAllowed(aRtxIsAllowed); + } + // This is the direction JS wants. It might not actually happen. SdpDirectionAttribute::Direction mJsDirection;