Bug 1358224 - pt 1 - addRIDExtension and addRIDFilter chrome-only API for RID (RTP Stream Id) filtering of receive tracks. r=qdot
authorMichael Froman <mfroman@mozilla.com>
Wed, 26 Apr 2017 10:01:07 -0500
changeset 355575 55f0af5ad6611cc119a4ad4baf0a1ffd155c8cd6
parent 355574 043cdedf4903ad93f6e43105f7455349ab608a44
child 355576 cbecfb20b2272095a223f4bcd8b6ba68541812df
push id31732
push userkwierso@gmail.com
push dateFri, 28 Apr 2017 22:43:27 +0000
treeherdermozilla-central@1c994cd72265 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1358224
milestone55.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 1358224 - pt 1 - addRIDExtension and addRIDFilter chrome-only API for RID (RTP Stream Id) filtering of receive tracks. r=qdot The simulcast mochitests exhibit an intermittent failure due to ssrc-based filtering that can be solved by filtering by RID. The RTP header parser used in MediaPipeline also needs to have the RID RTP header extension specified in order for it to properly parse the RTP header and allow filtering on RID. MozReview-Commit-ID: E54HCGLVYDk
dom/media/PeerConnection.js
dom/webidl/PeerConnectionImpl.webidl
dom/webidl/RTCPeerConnection.webidl
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -1163,16 +1163,24 @@ class RTCPeerConnection {
   getReceivers() {
     return this._receivers;
   }
 
   mozSelectSsrc(receiver, ssrcIndex) {
     this._impl.selectSsrc(receiver.track, ssrcIndex);
   }
 
+  mozAddRIDExtension(receiver, extensionId) {
+    this._impl.addRIDExtension(receiver.track, extensionId);
+  }
+
+  mozAddRIDFilter(receiver, rid) {
+    this._impl.addRIDFilter(receiver.track, rid);
+  }
+
   get localDescription() {
     this._checkClosed();
     let sdp = this._impl.localDescription;
     if (sdp.length == 0) {
       return null;
     }
     return new this._win.RTCSessionDescription({ type: this._localType, sdp });
   }
--- a/dom/webidl/PeerConnectionImpl.webidl
+++ b/dom/webidl/PeerConnectionImpl.webidl
@@ -59,16 +59,18 @@ interface PeerConnectionImpl  {
   RTCRtpParameters getParameters(MediaStreamTrack track);
   [Throws]
   void closeStreams();
 
   sequence<MediaStream> getLocalStreams();
   sequence<MediaStream> getRemoteStreams();
 
   void selectSsrc(MediaStreamTrack recvTrack, unsigned short ssrcIndex);
+  void addRIDExtension(MediaStreamTrack recvTrack, unsigned short extensionId);
+  void addRIDFilter(MediaStreamTrack recvTrack, DOMString rid);
 
   /* As the ICE candidates roll in this one should be called each time
    * in order to keep the candidate list up-to-date for the next SDP-related
    * call PeerConnectionImpl does not parse ICE candidates, just sticks them
    * into the SDP.
    */
   [Throws]
   void addIceCandidate(DOMString candidate, DOMString mid, unsigned short level);
--- a/dom/webidl/RTCPeerConnection.webidl
+++ b/dom/webidl/RTCPeerConnection.webidl
@@ -116,16 +116,20 @@ interface RTCPeerConnection : EventTarge
                         MediaStream... moreStreams);
   void removeTrack(RTCRtpSender sender);
 
   sequence<RTCRtpSender> getSenders();
   sequence<RTCRtpReceiver> getReceivers();
 
   [ChromeOnly]
   void mozSelectSsrc(RTCRtpReceiver receiver, unsigned short ssrcIndex);
+  [ChromeOnly]
+  void mozAddRIDExtension(RTCRtpReceiver receiver, unsigned short extensionId);
+  [ChromeOnly]
+  void mozAddRIDFilter(RTCRtpReceiver receiver, DOMString rid);
 
   void close ();
   attribute EventHandler onnegotiationneeded;
   attribute EventHandler onicecandidate;
   attribute EventHandler onsignalingstatechange;
   attribute EventHandler onaddstream; // obsolete
   attribute EventHandler onaddtrack;  // obsolete
   attribute EventHandler ontrack;     // replaces onaddtrack and onaddstream.
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -2361,16 +2361,30 @@ PeerConnectionImpl::SelectSsrc(MediaStre
       if (it != pipelines.end()) {
         it->second->SelectSsrc_m(aSsrcIndex);
       }
     }
   }
   return NS_OK;
 }
 
+nsresult
+PeerConnectionImpl::AddRIDExtension(MediaStreamTrack& aRecvTrack,
+                                    unsigned short aExtensionId)
+{
+  return NS_OK;
+}
+
+nsresult
+PeerConnectionImpl::AddRIDFilter(MediaStreamTrack& aRecvTrack,
+                                 const nsAString& aRid)
+{
+  return NS_OK;
+}
+
 NS_IMETHODIMP
 PeerConnectionImpl::RemoveTrack(MediaStreamTrack& aTrack) {
   PC_AUTO_ENTER_API_CALL(true);
 
   std::string trackId = PeerConnectionImpl::GetTrackId(aTrack);
 
   nsString wideTrackId;
   aTrack.GetId(wideTrackId);
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -452,16 +452,30 @@ public:
 
   NS_IMETHODIMP_TO_ERRORRESULT(SelectSsrc, ErrorResult &rv,
                                dom::MediaStreamTrack& aRecvTrack,
                                unsigned short aSsrcIndex)
   {
     rv = SelectSsrc(aRecvTrack, aSsrcIndex);
   }
 
+  NS_IMETHODIMP_TO_ERRORRESULT(AddRIDExtension, ErrorResult &rv,
+                               dom::MediaStreamTrack& aRecvTrack,
+                               unsigned short aExtensionId)
+  {
+    rv = AddRIDExtension(aRecvTrack, aExtensionId);
+  }
+
+  NS_IMETHODIMP_TO_ERRORRESULT(AddRIDFilter, ErrorResult& rv,
+                               dom::MediaStreamTrack& aRecvTrack,
+                               const nsAString& aRid)
+  {
+    rv = AddRIDFilter(aRecvTrack, aRid);
+  }
+
   nsresult GetPeerIdentity(nsAString& peerIdentity)
   {
     if (mPeerIdentity) {
       peerIdentity = mPeerIdentity->ToString();
       return NS_OK;
     }
 
     peerIdentity.SetIsVoid(true);