-
Notifications
You must be signed in to change notification settings - Fork 26
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
Should we rename SFrameTransform and RTCRtpScriptTransform #65
Comments
@alvestrand mentionned we could find better names. |
Firstly, the streams spec is particular about what can be called "streams", so we should use "stream" when it fits. Secondly, transform streams in the platform seem come in pairs: TextEncoderStream includes GenericTransformStream;
TextDecoderStream includes GenericTransformStream;
CompressionStream includes GenericTransformStream;
DecompressionStream includes GenericTransformStream; To follow that would mean changing from: SFrameTransform includes GenericTransformStream; ...to SFrameEncrypterStream includes GenericTransformStream;
SFrameDecrypterStream includes GenericTransformStream; This seems more ergonomic in JS. E.g. instead of transceiver.sender.transform = new SFrameTransform();
transceiver.receiver.transform = new SFrameTransform({role: "decrypt"); ...we'd avoid the boolean arg and just have: transceiver.sender.transform = new SFrameEncrypterStream();
transceiver.receiver.transform = new SFrameDecrypterStream(); |
Currently, one can simply write: transceiver.sender.transform = new SFrameTransform();
transceiver.receiver.transform = new SFrameTransform(); The 'role' is only used when using SFrameTransform as part of a JS-based pipe (see https://w3c.github.io/webrtc-insertable-streams/#sframe-transform-algorithm). I am not a big fan of XXStream names for transforms. SFrameTransform mirrors well RTCRtpSender/RTCRtpReceiver 'transform' attribute name. |
True, though I don't know how much to infer from typeless argument names. It looks like the streams spec has specifically blessed the name "stream" for arguments to both await src.pipeThrough(a).pipeThrough(b).pipeTo(c); // a, b and c are "streams" (but really only c)
Or even transforms a stream of data? @domenic any comment on which naming strategy we should follow?
Ah, I missed that. But
I worry this is too clever and defeats encapsulation, composition, and early error detection. E.g. are you saying the following would work as long as onrtctransform = async ({readable, writable}) => {
const sframe = new SFrameTransform({role: "decrypt"});
if (foo) {
readable = readable.pipeThrough(foo);
}
await readable.pipeThrough(sframe).pipeTo(writable);
} I think it would be better to explicitly have a |
I like the |
Right, I should fix that.
That should work too given how insertable stream pipeline and data is bound to an owner. I would like to get a full proposal here for SFrameTransform, RTCRtpScriptTransform, RTCRtpSender.transform and RTCRtpReceiver.transform. I would first judge on consistency inside the spec, then consistency with other specs. Funnily, we seem to lean towards removing stream from the title of the spec. |
Also in scope: RTCRtpScriptTransformer and DedicatedWorkerGlobalScope.onrtctransform |
Too late for renaming, closing |
And also RTCRtpScriptTransformer
The text was updated successfully, but these errors were encountered: