Currently their methods return 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 IParser and IComposer interfaces
Update implementations:
rtp::Parser
rtp::Composer
fec::Parser
fec::Composer
rtcp::Parser
rtcp::Composer
Report appropriate statuses:
when allocation failed, return StatusNoMem
when buffer is too small, return StatusBadBuffer
when packet is malformed, return StatusBadPacket
on success, return StatusOK
Update users of parsers and composers. They should forward status to upper level:
fec::BlockReader
fec::BlockWriter
packet::Shipper
audio::Packetizer
rtcp::Communicator
pipeline::ReceiverEndpoint
pipeline::SenderEndpoint
Testing
Add unit tests for rtp::Parser and rtp::Composer that check returned statuses in case of errors.
Add unit tests for fec::Parser and fec::Composer that check returned statuses in case of errors.
Add unit tests for components which use parsers and composers and check that they forward statuses from parser/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::IParser and packet::IComposer are interfaces for protocol-specific (de)serializators. See documentation.
Currently their methods return 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