w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.

Home Page:https://w3c.github.io/webcodecs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assign VideoFrame resource to [[resource reference]] in BufferSource constructor

Yahweasel opened this issue · comments

This is pedantic (hopefully in the way that spec issues should be pedantic).

In the VideoFrame constructor using a BufferSource, nothing actually assigns to [[resource reference]]. In 14.1 and 15.1, we let resource be a media resource, and in 17–20 we get some of its properties (its coded size), but there is no step to actually keep the resource after this algorithm, akin to AudioData's constructor's 4.10, “assign resourceReference to [[resource reference]]”.

This is done correctly in (I believe) every other algorithm that creates a VideoFrame, e.g. the "create a VideoFrame" algorithm, and even in the image source constructor, just not in the buffer source constructor. The constructor does not reference any algorithm to do this otherwise.

Yeah good catch, clearly an oversight, thanks for reporting. This is more like something incorrect rather than pedantic, it's kind of the goal of specifications to be quite specific.

Continuing the pedantry, every other resource assignment has resource reference as "a reference to" resource before assigning it, e.g.

3. Let |resourceReference| be a reference to |resource|.

True, but it's all references on the Web, so it's correct.

True, but it's all references on the Web, so it's correct.

Exactly the opinion I had of all the other "reference to resource" mentions in the spec. Was this not going to be a reference? 🤣