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

--HG--
extra : rebase_source : b53085f23cb6558611aa7622f55637e19439c9c3
This commit is contained in:
Michael Froman 2017-04-26 10:01:07 -05:00
parent 45df902a41
commit c526c139fc
5 changed files with 42 additions and 0 deletions

View File

@ -1168,6 +1168,14 @@ class RTCPeerConnection {
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;

View File

@ -64,6 +64,8 @@ interface PeerConnectionImpl {
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

View File

@ -121,6 +121,10 @@ interface RTCPeerConnection : EventTarget {
[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;

View File

@ -2366,6 +2366,20 @@ PeerConnectionImpl::SelectSsrc(MediaStreamTrack& aRecvTrack,
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);

View File

@ -457,6 +457,20 @@ public:
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) {