Hackathon - a point in time (Sunday morning)

So far, I've been able to spend the day hacking.

And the result is a working example of how to do what "encoded 
transform" does in a different API:

   const frameSource = audioPassingPc.getSenders()[0].divertFrames();

   // This class definition defines the work done.
   // Constructor is called with an EncodedFramesource as input.
   class CountingFrameSource extends EncodedFrameSource {
     constructor(firstSource) {
       super();
       const frameCounter = new TransformStream({
         transform: (frame, controller) => {
           frameCount += 1;
           audioCounterDiv.innerText = frameCount;
           controller.enqueue(frame);
         }
       });
       this.readable = frameSource.readable.pipeThrough(frameCounter);
     }
   };

   const outgoingFrameSource = new CountingFrameSource(frameSource);
audioPassingPc.getSenders()[0].insertFrames(outgoingFrameSource);

The implementation is a shim on top of the Chrome version of 
webrtc-encoded-transform.

So far, signals are not connected (there are no signals).

Code is available at 
https://github.com/alvestrand/hackathon-encoded-media - since it's only 
me so far, I'm just pushing stuff to the main branch; once others want 
to contribute, we'll start using PRs.

Now to construct some *non*working samples and see what they will look 
like. And then see if we can make them work.

    Harald

Received on Sunday, 6 November 2022 10:24:01 UTC