Re: [whatwg/streams] Allow web devs to synchronize branches with tee()? (#1157)

> { synchronized: true} would slow down the fastest consumer which is undesirable in a realtime video pipeline.

It's desirable in the first use case I mentioned in the OP, and shouldn't get in the way of dropping frames downstream.

> If we look at what happens in existing native pipelines like 'render local + encode local', frames are being dropped as needed by both renderer and encoder.

Exactly. Dropping frames downstream ("renderer and encoder") is a common strategy. A sink resolves promises at its discretion, so the streams spec isn't in the way there.

What we're talking about here is how things to degrade when that fails, and giving applications tools to control this. Drift (`{synchronized: false}`) seems a lot harder reason about, manage and recover from. But if an app thinks it can — e.g. it has context (reasons or strategy) to expect its slow branch to only occasionally stutter and always recover quickly — then go for it.

> The slow consumer also probably wants to process the freshest frame consumed by the fast consumer.

I don't follow this characterization. If a consumer misses a frame, then the "freshest" frame is the one it has to wait for, since the one available immediately is no longer fresh.

As a baseline, in the sunny case, where both branches are within the time budget of the source frame rate, both branches wait for the next (fresh) frame (i.e. in sync), and this is entirely normal and not "slow".

-- 
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/issues/1157#issuecomment-894657272

Received on Saturday, 7 August 2021 13:48:11 UTC