Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Describe more precisely transfered track lifetime management. #30

Merged
merged 7 commits into from
Aug 26, 2021
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,29 @@ <h2>Examples</h2>
<h2>Transferable MediaStreamTrack</h2>
<div>
<p>A {{MediaStreamTrack}} is a <a data-cite="!HTML/#transferable-objects">transferable object</a>.
This allows manipulating real-time media outside the context it was requested or created in, for instance in workers or third-party iframes.</p>
<p>To preserve the existing privacy and security infrastructure, in particular for capture tracks, we need proper track and source lifetime management.
A future PR will properly specify this management.</p>
This allows manipulating real-time media outside the context it was requested or created in,
for instance in workers or third-party iframes.</p>
<p>To preserve the existing privacy and security infrastructure, in particular for capture tracks,
the track source lifetime management remains tied to the context that created it.
The transfer algorithm MUST ensure the following behaviors:</p>
<p>
<ol>
<li><p>The context named <var>originalContext</var> that created a track named <var>originalTrack</var> remains in control
of the <var>originalTrack</var> source, named <var>trackSource</var>, even when <var>originalTrack</var> is transferred into <var>transferredTrack</var>.</p>
</li>
<li>
<p>In particular, <var>originalContext</var> remains the proxy to privacy indicators of <var>trackSource</var>.
<var>transferredTrack</var> or any of its clones are considered as tracks using <var>trackSource</var>
as if they were tracks created in and controlled by <var>originalContext</var>.</p>
</li>
<li><p>When <var>originalContext</var> goes away, <var>trackSource</var> gets ended, thus <var>transferredTrack</var> gets ended.</p></li>
<li><p>When <var>originalContext</var> would have muted/unmuted <var>originalTrack</var>, <var>transferredTrack</var> gets muted/unmuted.</p></li>
<li><p>If <var>transferredTrack</var> is cloned in <var>transferredTrackClone</var>, <var>transferredTrackClone</var> is tied to <var>trackSource</var>.
It is not tied to <var>originalTrack</var> in any way.</p></li>
<li><p>If <var>transferredTrack</var> is transferred into <var>transferredAgainTrack</var>, <var>transferredAgainTrack</var> is tied to <var>trackSource</var>.
It is not to <var>transferredTrack</var> or <var>originalTrack</var> in any way.</p></li>
</ol>
</p>
</div>
<div>
<p>The WebIDL changes are the following:
Expand Down Expand Up @@ -389,7 +408,8 @@ <h2>Transferable MediaStreamTrack</h2>
<li><p>Initialize <var>track</var>.{{MediaStreamTrack/readyState}} to <var>dataHolder</var>.`[[readyState]]`.</p></li>
<li><p>Initialize <var>track</var>.{{MediaStreamTrack/enabled}} to <var>dataHolder</var>.`[[enabled]]`.</p></li>
<li><p>Initialize <var>track</var>.{{MediaStreamTrack/muted}} to <var>dataHolder</var>.`[[muted]]`.</p></li>
<li><p>Initialize <var>track</var> underlying source to <var>dataHolder</var>.`[[source]]`.</p></li>
<li><p>[=Initialize the underlying source=] of <var>track</var> to <var>dataHolder</var>.`[[source]]` with
{{MediaStreamTrack/tieSourceToContext}} equal to <code>false</code>.</p></li>
<li><p>Set <var>track</var>'s constraints to <var>dataHolder</var>.`[[constraints]]`.</p></li>
</ol>
</div>
Expand Down