w3c / webrtc-rtptransport

Repository for the RTPTransport specification of the WebRTC Working Group
https://w3c.github.io/webrtc-rtptransport/
Other
18 stars 7 forks source link

Examples pipe multiple streams into a single writable #15

Open jan-ivar opened 11 months ago

jan-ivar commented 11 months ago

The examples won't work as written for more than one sender:

const rtpTransport = pc.createRtpTransport();
pc.getSenders().forEach((sender) => {
  pc.createEncodedStreams().readable.
      pipeThrough(createPacketizingTransformer()).pipeTo(rtpTransport.writable);
});

...because multiple streams cannot be piped into a single writable.

It's not super-clear what a single "transport" is meant to be scoped to.

  1. Is there one for the entire peer connection?
  2. Is there one per transceiver?
  3. Is there one per sender and receiver?
  4. Is there one per transform?
  5. Can apps create as many as they wish?

Is it just a packetizer sink? — In #14 I end up with number 4.

Conceptually, is this just be some option on a transform to change expected inputs and outputs? E.g. on the sender:

  1. encodedFrame → encodedFrame (default, e.g. e2ee)
  2. encodedFrame → packet (e.g adding metadata)
  3. Frame → encodedFrame (JS encoder)
  4. Frame → packet (hold my beer)

If so, this proposal may be closer to @alvestrand's than I previously appreciated.

aboba commented 11 months ago

The example has multiple problems:

So there is a lot to fix.

dontcallmedom-bot commented 11 months ago

This issue was mentioned in WEBRTCWG-2023-12-05 (Page 62)