w3c / mediacapture-extensions

Extensions to Media Capture and Streams by the WebRTC Working Group
https://w3c.github.io/mediacapture-extensions/
Other
19 stars 14 forks source link

Should media delivery during transfer be specified? #72

Open dogben opened 1 year ago

dogben commented 1 year ago

Regarding Transferable MediaStreamTrack, I think there is only one reasonable approach for handling delivery of media (video frames or audio data) during transfer: media stops flowing before postMessage returns on the sending side and does not start flowing until the time the transferred MediaStreamTrack is connected to a sink on the receiving side. All intermediate frames/data are dropped.

A consequence is that media won't be delivered while a transfer is in progress, which may be surprising to some developers.

There are a few unreasonable (IMO) approaches too:

If I'm correct and there's only one reasonable approach here based on this and other specs, then perhaps nothing needs to be added to the specification for Transferable MediaStreamTrack. However, if it's likely that different UAs would choose different approaches to media delivery, we should consider nailing this down so that developers don't start relying on behavior that's not specified, e.g. if a UA provides (best-effort) continuous media delivery during a transfer.

eladalon1983 commented 1 year ago

How would an application notice a difference between UAs employing queueing/dropping? Unless I am mistaken, frames can already be dropped during normal operation, or be spaced out less/more than usual, e.g. if there's CPU congestion or if the hardware acts up. If so, neither approach yields new JS-observable behavior. But it might change the frequency different scenarios manifest, which is probably not an issue spec-wise. Or wdyt?