Skip to content

FrameTransform Interface does not match TransformStream transformer Interface #1569

Open
@maikthomas

Description

@maikthomas

Please read first!

Please use discuss-webrtc for general technical discussions and questions.
If you have found an issue/bug with the native libwebrtc SDK or a browser's behaviour around WebRTC please create an issue in the relevant bug tracker. You can find more information on how to submit a bug and do so in the right place here

  • I understand that issues created here are only relevant to the samples in this repo - not browser or SDK bugs
  • I have provided steps to reproduce
  • I have provided browser name and version
  • I have provided a link to the sample here or a modified version thereof

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed.

Browser affected

No browser affected, just a code question

Description

While looking into Insertable Streams samples e.g. https://github.com/webrtc/samples/blob/gh-pages/src/content/insertable-streams/video-processing/js/canvas-transform.js
I noticed that the Transformers implement FrameTransform from here:
https://github.com/webrtc/samples/blob/gh-pages/src/content/insertable-streams/video-processing/js/pipeline.js#L73

This Interface is very similar to the transform parameter of the TransformStream constructor:
https://developer.mozilla.org/en-US/docs/Web/API/TransformStream/TransformStream#parameters
See also typed TS def for Transformer: https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts#L1734

The differences I see are in these method names:
init -> start
destroy -> flush

Would it make sense for the transformers in this repo to match the interface above? Or am I mixing different concepts here?

Steps to reproduce

N/A

Expected results

N/A

Actual results

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions