Currently its methods return bool (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 IComposer interface and implementations:
rtp::Composer
fec::Composer
rtcp::Composer
Report appropriate statuses:
when allocation failed, return StatusNoMem
when buffer is too small, return StatusBadBuffer
on success, return StatusOK
Update users of composers. They should forward status to upper level:
fec::BlockWriter
packet::Shipper
audio::Packetizer
rtcp::Communicator
Testing
Add unit tests for rtp::Composer and fec::Parser that check returned statuses in case of errors.
Add unit tests for components which use composers, and check that they forward statuses from composer to the upper level (e.g. if Composer fails with StatusNoMem, Shipper::write() returns StatusNoMem). One test per component should be enough.
Summary
packet::IComposer is interface for protocol-specific serializators. See documentation.
Currently its methods return bool (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