Skip to content
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

Use Transform API for MpegTsDemuxer #10

Merged
merged 1 commit into from
May 8, 2021
Merged

Use Transform API for MpegTsDemuxer #10

merged 1 commit into from
May 8, 2021

Conversation

slifty
Copy link
Member

@slifty slifty commented May 8, 2021

Description

This PR replaces the old callback pattern with the shiny Transform Stream pattern

MpegTsDemuxer should now be treated as a Duplex stream -- it can be used as part of a pipeline.

Related Issues

Resolves #7

The original TSDemuxer API used a callback parameter to emit extracted
Packets.  This replaces that with NodeJS's built in Transform Stream
API.

https://nodejs.org/api/stream.html#stream_class_stream_transform

Really what's happening is that:

1) We hijacked `cb` to insteadp invoke `push`
2) `process` is now private and only invoked from _transform
3) `finalize` is now private and only invoked from _flush

Issue #7
@slifty slifty merged commit d579f76 into main May 8, 2021
@slifty slifty deleted the 7-extend-transform branch May 8, 2021 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update MpegTsDemuxer to implement the Transform API
1 participant