Skip to content

Reset for TransformStream (and WritableStream?) #1026

Open
@ricea

Description

@ricea

On seek, WebCodecs would like to be able to throw away all existing data in the decoder so that they don't display any more frames from before the seek point.

It's easy enough to reset the decoder itself, but there still may be data queued in the writable side of the transform which we need to get rid of. There doesn't seem to be a clean way to do this at the moment.

I tentatively propose a reset() method for TransformStream which throws away any queued chunks. This might delegate to abstract operations on ReadableStream and WritableStream which do the actual queue reset.

It would probably be useful to have an optional reset() method on the underlying transformer. This would have unusual semantics that it could be called while a transform is in progress.

reset() might also be useful for WritableStream although I don't have a specific use case. It might even be useful for ReadableStream but I'm even further from having a use case for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions