W3C home > Mailing lists > Public > public-webrtc@w3.org > March 2015

Should pc.getRemoteStreams() include all remote tracks after pcsetRemoteDescription() ?

From: Iñaki Baz Castillo <ibc@aliax.net>
Date: Wed, 4 Mar 2015 19:54:38 +0100
Message-ID: <CALiegfkYEhW0qxLPY5oNphyTJKpVwVp-ZLT10_bbo2-aW9wrgQ@mail.gmail.com>
To: "public-webrtc@w3.org" <public-webrtc@w3.org>
Hi all.

The spec is unclear about this topic. I will describe the current
"issue" in Firefox (which may be it's not an issue):

1) App creates an offer, sends it to the peer and receives a remote
answer with N tracks.

2) App calls to pc.setRemoteDescription().

3) Within the success callback the app calls to pc.getRemoteStreams().
It gets no remote streams or tracks.

4) After a few seconds onaddstream fires.

5) After that, calling to pc.getRemoteStreams() return the proper
media stream with all its remote tracks.


My understanding it that getRemoteStreams() should be deterministic.
Nothing has happened between bullets 3 and 5. The onaddstream event is
just a native event but the real action happened during bullet 2 and
3, so I consider that bullet 3 should return the full list of remote
tracks without waiting some JS cycles for internal stuff.


The point here is that the spec is unclear about onaddstream:

"It is called any time a MediaStream is added by the remote peer. This
will be fired only as a result of setRemoteDescription. Onaddstream
happens as early as possible after the setRemoteDescription. This
callback does not wait for a given media stream to be accepted or
rejected via SDP negotiation."

Well, what does "as early as possible" mean? :)


Anyhow, the issue above is not about when onaddstream is fired. Since
it is an event there is no need for it to be called at a specific JS
cycle. But my question is:


Should pc.getRemoteStreams() return the full list of remote
streams/tracks ONCE setRemoteDescription() succeeded? Currently
Firefox does not behave in that way, and instead getRemoteStreams()
just return the proper data once onaddstream has been emitted.


Thanks a lot.


-- 
Iñaki Baz Castillo
<ibc@aliax.net>
Received on Wednesday, 4 March 2015 18:55:25 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:43 UTC