Skip to content

Commit 151cfc6

Browse files
authored
Merge pull request #119 from youennf/add-video-frame-close-note
Add a note to close VideoFrames explicitly
2 parents 9f59da8 + 3461c8d commit 151cfc6

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

index.bs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ associated {{ReadableStream}} only when a read request has been issued on
108108
the stream. The idea is to avoid the stream's internal buffering, which
109109
does not give the UA enough flexibility to choose the buffering policy.
110110

111+
<p class="note">
112+
Authors are encouraged to call close() on output {{VideoFrame|VideoFrames}} immediately when frames are no longer needed.
113+
The underlying media resources are owned by the {{MediaStreamTrack}}'s source.
114+
Failing to release them (or waiting for garbage collection) can cause the source to stop emitting new {{VideoFrame|VideoFrames}}.
115+
</p>
116+
111117
### Interface definition ### {#track-processor-interface}
112118

113119
<pre class="idl">
@@ -224,13 +230,11 @@ It is defined by running the following steps:
224230
At any time, the UA MAY [=list/remove=] any frame from |processor|.`[[queue]]`.
225231
The UA may decide to remove frames from |processor|.`[[queue]]`, for example,
226232
to prevent resource exhaustion or to improve performance in certain situations.
227-
</dd>
228233

229234
<p class="note">
230235
The application may detect that frames have been dropped by noticing that there
231236
is a gap in the timestamps of the frames.
232237
</p>
233-
</dl>
234238

235239
When the `[[track]]` of a {{MediaStreamTrackProcessor}} |processor|
236240
[=track|ends=], the [=processorClose=] algorithm must be
@@ -310,19 +314,22 @@ The <dfn>writeFrame</dfn> algorithm is given a |generator| and a |frame| as inpu
310314
1. Run the [=Close VideoFrame=] algorithm with |frame|.
311315
1. Return [=a promise resolved with=] undefined.
312316

317+
The <dfn>closeWritable</dfn> algorithm is given a |generator| as input.
318+
It is defined by running the following steps.
319+
1. For each track `t` sourced from |generator|, [=track|end=] `t`.
320+
2. Return [=a promise resolved with=] undefined.
321+
322+
</dd>
323+
</dl>
324+
313325
<p class="note">
314326
When the media data is sent to a track, the UA may apply processing
315327
(e.g., cropping and downscaling) to ensure that the media data sent
316328
to the track satisfies the track's constraints. Each track may receive a
317329
different version of the media data depending on its constraints.
318330
</p>
319331

320-
The <dfn>closeWritable</dfn> algorithm is given a |generator| as input.
321-
It is defined by running the following steps.
322-
1. For each track `t` sourced from |generator|, [=track|end=] `t`.
323-
2. Return [=a promise resolved with=] undefined.
324-
325-
</dd>
332+
<dl>
326333
<dt><dfn attribute for=VideoTrackGenerator>muted</dfn></dt>
327334
<dd>Mutes the {{VideoTrackGenerator}}. The getter steps are to return
328335
[=this=].`[[isMuted]]`. The setter steps, given a value |newValue|, are as follows:

0 commit comments

Comments
 (0)