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

Re: [webrtc-pc] The threading model of webrtc-pc: When are effects of in-parallel stuff surfaced? (#2502)

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Tue, 31 Mar 2020 19:26:06 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-606825863-1585682765-sysbot+gh@w3.org>
Sorry I'm not familiar enough with how Chrome works to follow, but we can't break the synchronous nature of addTrack.

> why are we not awaiting for SRD() before we do addTrack()?

As definers of the API, it's our job to define what happens, not ask why it's done. ;)

But since you ask me to defend taking action: The reason I think we must solve this is this one:
button.onclick = () => pc.addTrack(track, stream); // Must always get associated
 1. If addTrack happens right before SRD, then SRD associates it.
 2. If addTrack happens right after SRD success, then addTrack associates it.
 3. If addTrack happens right in the middle of SRD, then it is not associated (theoretically)

Since both 1 and 2 associate, it seems pretty darn obvious that 3 should as well. Especially since add

Note I haven't actually been able to _observe_ 3 in any implementation, as it's hard to test.
I think it might suffice to say something like _"If addTrack was called during the process to apply description, then start the process over."_ I'll do a PR.

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2502#issuecomment-606825863 using your GitHub account
Received on Tuesday, 31 March 2020 19:26:09 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:50 UTC