Re: [whatwg/streams] Explainer for proposed stream changes related to VideoFrame processing (PR #1193)

@youennf commented on this pull request.



> +      // At this point, videoFrame has been transfered within controller.enqueue call. frameCountTransform cannot mutate it.
+      if (!(++frameCount % 30) && frameCountTransform.onEach30Frame)
+          frameCountTransform.onEach30Frame(frameCount);
+    } catch {
+      videoFrame.close();
+    }

> It cannot mutate it, because it cannot even access it, is that right?

It has access to the object, but no longer to the underlying bytes.

> Also, don't we need to rethrow in the catch, to not encourage overriding default error handling?

One of the complaint we heard from streams was that errors propagate very easily, while there may be recoverable errors hence why I did not add throw there. I would prefer calling the error method explicitly in case of unrecoverable errors.

> I also worry this risks calling close on a transferred object, or is that benign? 

I think it is begnin.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1193#discussion_r769392449

Received on Wednesday, 15 December 2021 08:51:46 UTC