Improve input/output consistency of encoders & decoders #8
charlie-dufort
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
As far as consistency, for sure. To make it easier to analyze, @charlie-dufort, could you copy paste the signatures of the objects in question, and perhaps a link to their code? I would usually suggest a decorator to do this input and output job, separating that concern. Yet theses codecs will usually know a lot of performance pressure (for example, encoding or decoding live multi-channel streams), so efficiency counts, and probably better in this case we do it in-line. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ChunkedEncoder
takes either a Collection or an Iterator of frames, and returns a Collection of bytes.ChunkedDecoder
can only take a Collection of bytes, and returns a Collection of frames.IterativeDecoder
can only take a Collection of bytes, and returns a Iterator of frames.I suggest we add a little more consistency between the type of inputs and outputs:
ChunkedEncoder
would take either a Collection or an Iterator of frames, and would return either a Collection or an Iterator of bytes, depending on the input type.ChunkedDecoder
would take either a Collection or an Iterator of bytes, and would return either a Collection or an Iterator of frames, depending on the input type.IterativeDecoder
would take either a Collection or an Iterator bytes, and would return either an Iterator of frames, or an Iterator of iterators of frames, depending on the input type.Implementation and documentation update should take about 4 hrs
Beta Was this translation helpful? Give feedback.
All reactions