Bug 1531803 - Part 1: Stop copying the previous msid when generating new SDP. r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 29 Apr 2019 15:51:24 +0000
changeset 530748 cbe9386e0d7a1359b45928bb290e25e1671a0d31
parent 530747 86910675df1395b31f809fc954ad044d61e1ebd7
child 530749 14e1bfbd006034df2786ed5c16ec1c4d60315ff8
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1531803
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531803 - Part 1: Stop copying the previous msid when generating new SDP. r=mjf Differential Revision: https://phabricator.services.mozilla.com/D25794
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
media/webrtc/signaling/src/jsep/JsepSessionImpl.h
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -372,17 +372,16 @@ JsepSession::Result JsepSessionImpl::Cre
   }
 
   SetupBundle(sdp.get());
 
   if (mCurrentLocalDescription) {
     rv = CopyPreviousTransportParams(*GetAnswer(), *mCurrentLocalDescription,
                                      *sdp, sdp.get());
     NS_ENSURE_SUCCESS(rv, dom::PCError::OperationError);
-    CopyPreviousMsid(*mCurrentLocalDescription, sdp.get());
   }
 
   *offer = sdp->ToString();
   mGeneratedOffer = std::move(sdp);
   ++mSessionVersion;
 
   return Result();
 }
@@ -503,17 +502,16 @@ JsepSession::Result JsepSessionImpl::Cre
     NS_ENSURE_SUCCESS(rv, dom::PCError::OperationError);
   }
 
   if (mCurrentLocalDescription) {
     // per discussion with bwc, 3rd parm here should be offer, not *sdp. (mjf)
     rv = CopyPreviousTransportParams(*GetAnswer(), *mCurrentRemoteDescription,
                                      offer, sdp.get());
     NS_ENSURE_SUCCESS(rv, dom::PCError::OperationError);
-    CopyPreviousMsid(*mCurrentLocalDescription, sdp.get());
   }
 
   *answer = sdp->ToString();
   mGeneratedAnswer = std::move(sdp);
   ++mSessionVersion;
 
   return Result();
 }
@@ -1214,32 +1212,16 @@ nsresult JsepSessionImpl::CopyPreviousTr
           &newLocal->GetMediaSection(i));
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
 
   return NS_OK;
 }
 
-void JsepSessionImpl::CopyPreviousMsid(const Sdp& oldLocal, Sdp* newLocal) {
-  for (size_t i = 0; i < oldLocal.GetMediaSectionCount(); ++i) {
-    const SdpMediaSection& oldMsection(oldLocal.GetMediaSection(i));
-    SdpMediaSection& newMsection(newLocal->GetMediaSection(i));
-    if (oldMsection.GetAttributeList().HasAttribute(
-            SdpAttribute::kMsidAttribute) &&
-        !mSdpHelper.MsectionIsDisabled(newMsection)) {
-      // JSEP says this cannot change, no matter what is happening in JS land.
-      // It can only be updated if there is an intermediate SDP that clears the
-      // msid.
-      newMsection.GetAttributeList().SetAttribute(
-          new SdpMsidAttributeList(oldMsection.GetAttributeList().GetMsid()));
-    }
-  }
-}
-
 nsresult JsepSessionImpl::ParseSdp(const std::string& sdp,
                                    UniquePtr<Sdp>* parsedp) {
   UniquePtr<Sdp> parsed = mSipccParser.Parse(sdp);
   if (!parsed) {
     std::string error = "Failed to parse SDP: ";
     mSdpHelper.appendSdpParseErrors(mSipccParser.GetParseErrors(), &error);
     JSEP_SET_ERROR(error);
     return NS_ERROR_INVALID_ARG;
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.h
@@ -187,17 +187,16 @@ class JsepSessionImpl : public JsepSessi
   void RollbackRemoteOffer();
   nsresult HandleNegotiatedSession(const UniquePtr<Sdp>& local,
                                    const UniquePtr<Sdp>& remote);
   nsresult AddTransportAttributes(SdpMediaSection* msection,
                                   SdpSetupAttribute::Role dtlsRole);
   nsresult CopyPreviousTransportParams(const Sdp& oldAnswer,
                                        const Sdp& offerersPreviousSdp,
                                        const Sdp& newOffer, Sdp* newLocal);
-  void CopyPreviousMsid(const Sdp& oldLocal, Sdp* newLocal);
   void EnsureMsid(Sdp* remote);
   void SetupBundle(Sdp* sdp) const;
   nsresult GetRemoteIds(const Sdp& sdp, const SdpMediaSection& msection,
                         std::vector<std::string>* streamIds,
                         std::string* trackId);
   nsresult CreateOfferMsection(const JsepOfferOptions& options,
                                JsepTransceiver& transceiver, Sdp* local);
   nsresult CreateAnswerMsection(const JsepAnswerOptions& options,