[webrtc-pc] Regarding "a=msid"

henbos has just created a new issue for https://github.com/w3c/webrtc-pc:

== Regarding "a=msid" ==
[JSEP Section 5.2.1 and 5.2.2](https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24#section-5.2.1) says:

> - For each MediaStream that was associated with the transceiver when it was created via addTrack or addTransceiver, an "a=msid" line, as specified in [I-D.ietf-mmusic-msid], Section 2.  If a MediaStreamTrack is attached to the transceiver's RtpSender, the "a=msid" lines MUST use that track's ID.  If no MediaStreamTrack is attached, a valid ID MUST be generated, in the same way that the implementation generates IDs for local tracks.
> - If no MediaStream is associated with the transceiver, a single "a=msid" line with the special value "-" in place of the MediaStream ID, as specified in [I-D.ietf-mmusic-msid], Section 3.  The track ID MUST be selected as described above.

[MSID Section 2](https://tools.ietf.org/html/draft-ietf-mmusic-msid-16#section-2) says:

> There may be multiple msid attributes in a single media description. This represents the case where a single MediaStreamTrack is present in multiple MediaStreams; the value of "msid-appdata" MUST be identical for all occurences.
> 
> Multiple media descriptions with the same value for msid-id and msid-appdata are not permitted.

It sounds to me that the following, while clearly intended to be permitted, is not permitted:
```
pc.addTransceiver(track);
pc.addTransceiver(track);
```
Because one spec says we MUST use the track's ID and stream ID "-" for both "a=msid" lines and the other say having two identical "a=msid" lines is not permitted.

What both Chrome and Firefox does is the second track will get a random "a=msid" value. Doesn't this go against the spec? @jan-ivar 
On the other hand, if you supply media streams the combination is no longer unique, and the following would allow you to reuse the track ID:
```
pc.addTransceiver(track, {streams:[new MediaStream()]});
pc.addTransceiver(track, {streams:[new MediaStream()]});
```
Because it would show up in SDP as "a track belonging to multiple streams". However current implementations (at least Chrome?) still generate a new ID.

**Proposals**
1. Clarify JSEP or MSID specs.
2. Clarify webrtc-pc to say that if the track ID has already been listed, generate a random one.
3. Stop supporting "a=msid", it only adds confusing, the 1.0 way is to rely on "transceiver.mid", not track IDs.

For related bug info, including code snippet to test this, see https://crbug.com/894231.

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2005 using your GitHub account

Received on Thursday, 11 October 2018 16:28:36 UTC