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

Return status code instead of bool in IFrameEncoder & IFrameDecoder #739

Open
gavv opened this issue Jun 23, 2024 · 5 comments
Open

Return status code instead of bool in IFrameEncoder & IFrameDecoder #739

gavv opened this issue Jun 23, 2024 · 5 comments
Labels
easy hacks The solution is expected to be straightforward even if you are new to the project help wanted An important and awaited task but we have no human resources for it yet refactoring

Comments

@gavv
Copy link
Member

gavv commented Jun 23, 2024

Summary

audio::IFrameEncoder and audio::IFrameDecoder are interfaces for encoding and decoding of audio packets.

Currently they both have begin_frame() and end_frame() methods that don't return any errors. We need to update them to return status::StatusCode, so that they can report error if it happens.

Implementation

  • Update IFrameEncoder and IFrameDecoder interfaces
  • Update implementations:
    • audio::PcmEncoder
    • audio::PcmDecoder
  • PCM encoder and decoder never fail, so they can just always return StatusOK. (Future implementation of IFrameEncoder and IFrameDecoder will be able to report errors, e.g. Opus)
  • Update audio::Packetizer and audio::Depacketizer, which use IFrameEncoder and IFrameDecoder interfaces. When encoder or decoder return error, packetizer and depacketizer should forward it to upper level.

Testing

  • Add unit test for Packetizer to check that it forwards error from encoder to upper level.
  • Add unit test for Depacketizer to check that it forwards error from decoder to upper level.
@gavv gavv added refactoring help wanted An important and awaited task but we have no human resources for it yet easy hacks The solution is expected to be straightforward even if you are new to the project labels Jun 23, 2024
@gavv gavv added this to Roc Toolkit Jul 6, 2024
@gavv gavv moved this to Help wanted in Roc Toolkit Jul 6, 2024
@runei

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@runei

This comment was marked as outdated.

@gavv

This comment was marked as outdated.

@NSHABV
Copy link

NSHABV commented Oct 29, 2024

Greetings, I would like to try my hand at this. Are there any more refactors planned for adjacent modules or am I free to fork master and begin developing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy hacks The solution is expected to be straightforward even if you are new to the project help wanted An important and awaited task but we have no human resources for it yet refactoring
Projects
Status: Help wanted
Development

No branches or pull requests

3 participants