Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using TransformStreams instead of exposing ReadableStream/WritableStream #48

Closed
youennf opened this issue Sep 30, 2020 · 3 comments

Comments

@youennf
Copy link
Collaborator

youennf commented Sep 30, 2020

It might be worth considering using TransformStreams instead of exposing ReadableStream/WritableStream directly.
One reason is consistency with other APIs like https://encoding.spec.whatwg.org/#interface-textencoderstream or https://encoding.spec.whatwg.org/#interface-textencoderstream.
This for instance makes it easier to define native transforms.
Not dealing with ReadableStream is also nice to remove some potential foot guns like cloning a ReadableStream.

@youennf
Copy link
Collaborator Author

youennf commented Nov 24, 2020

I updated a draft API at https://github.com/youennf/webrtc-insertable-streams/blob/modif/modifications.md along those lines for both a SFrame native transform as well as a script transform.

@alvestrand
Copy link
Contributor

I don't believe this will serve use cases where the desired result is processing in a generic worker.

The GenericTransformStream is the inverse of the ReadableStream/WritableStream pair exposed by an RTCRtpSender/Receiver; the TransformStream does something to what's sent on its writable and emits it on its readable, while the RTCRtpSender/Receiver emits stuff on its readable and expects to have the transformed result on its writable.

In pluggable terms, TransformStream is the plug, and RTCRtpSender/Receiver is the socket.

@youennf
Copy link
Collaborator Author

youennf commented Apr 1, 2021

I think this is fixed now with the introduction of SFrameTransform and RTCRtpScriptTransform.
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants