- From: guidou via GitHub <sysbot+gh@w3.org>
- Date: Wed, 27 Nov 2024 15:56:43 +0000
- To: public-webrtc-logs@w3.org
> Transfer does not require cloning. No one is saying that Transfer, which is a separate feature, requires cloning. The argument is that use cases that require or prefer the tracks on Window (which are arguably the majority) and just want the worker for media processing, need to transfer the track because the API requires it, even though media processing does not need the track. In some cases, like before/after a clone is an additional requirement. If a the use case requires just media processing on worker, there should not be an additional requirement to have da track in the worker. > It's the before/after use case showing the original camera track that needs it. Without that, no clone is needed (and one less track to stop). > This is a common use case, and there are many others that require or prefer the track on window and don't need or want a track in the worker. The current API shape forces a clone in such cases, which shouldn't be necessary. > > * The difference in code complexity is not that big in these two examples. > > Agree. 25 vs 40 lines doesn't seem enough to justify a bespoke API. > You're including code that is common to both cases in your counts, which makes the relative difference look smaller. If you count just the code related to track management, the relative difference is bigger. Also, the difference in complexity is not just line counts, but also the complexity of the abstractions involved. With the track only on Window, operations on the track are simple. You have the track, and you operate on it directly. No further abstractions are required. With the track split on two execution contexts, what used to be just a track for the application has to be modeled differently. Now you have to think in terms of an abstract track of which there are two replicas running on two different execution contexts, so you need to keep track of all those objects and define a consistency protocol. In a complex real-world application, this complexity compounds. If you want to use multiple tracks, and do processing on different workers, it becomes even more complex. Some use cases where this additional complexity is necessary might exist, but today there are a lot use cases where this extra complexity isn't needed and it just makes life difficult for developers. -- GitHub Notification of comment by guidou Please view or discuss this issue at https://github.com/w3c/mediacapture-transform/issues/116#issuecomment-2504235257 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 27 November 2024 15:56:44 UTC