Currently they both have begin_block() method that returns bool, which is true on success or false on error. We need to replace bool with status::StatusCode and return code that described why the operation failed.
Implementation
Update IBlockEncoder and IBlockDecoder interfaces
Update implementations:
fec::OpenfecEncoder
fec::OpenfecDecoder
Report appropriate statuses:
when allocation failed, return StatusNoMem
on success, return StatusOK
Update fec::BlockWriter and fec::BlockReader, which use IBlockEncoder and IBlockDecoder interfaces. When encoder or decoder return errors, writer and reader should forward it to upper level.
Testing
Add unit test to test_block_encoder_decoder.cpp to check that encoder/decoder returns StatusNoMem when allocation fails.
Add unit test to test_block_writer_reader_errors.cpp to check that writer/reader forward error from encoder/decoder to upper level.
Summary
fec::IBlockEncoder and fec::IBlockDecoder are interfaces for codec-specific encoding and decoding of FEC packets used for packet loss recovery. See documentation.
Currently they both have
begin_block()
method that returns bool, which is true on success or false on error. We need to replace bool with status::StatusCode and return code that described why the operation failed.Implementation
Testing
test_block_encoder_decoder.cpp
to check that encoder/decoder returns StatusNoMem when allocation fails.test_block_writer_reader_errors.cpp
to check that writer/reader forward error from encoder/decoder to upper level.