12#ifndef ROC_FEC_PARSER_H_
13#define ROC_FEC_PARSER_H_
24template <
class PayloadID, PayloadID_Type Type, PayloadID_Pos Pos>
32 : inner_parser_(inner_parser) {
37 if (buffer.size() <
sizeof(PayloadID)) {
39 (
int)
sizeof(PayloadID));
43 const PayloadID* payload_id;
45 payload_id = (
const PayloadID*)buffer.data();
48 (
const PayloadID*)(buffer.data() + buffer.size() -
sizeof(PayloadID));
66 fec.
payload = buffer.subslice(
sizeof(PayloadID), buffer.size());
68 fec.
payload = buffer.subslice(0, buffer.size() -
sizeof(PayloadID));
Base class for non-copyable objects.
Shared ownership intrusive pointer.
virtual bool parse(packet::Packet &packet, const core::Slice< uint8_t > &buffer)
Parse packet from buffer.
Parser(packet::IParser *inner_parser)
Initialization.
virtual bool parse(Packet &packet, const core::Slice< uint8_t > &buffer)=0
Parse packet from buffer.
const FEC * fec() const
FEC packet.
@ FlagRepair
Packet contains repair FEC symbols.
@ FlagFEC
Packet contains FEC header.
void add_flags(unsigned flags)
Add flags.
#define roc_log(level,...)
Print message to log.
@ Header
PayloadID comes before payload.
@ Repair
Source packet header of footer.
uint16_t blknum_t
FEC packet block number.
@ LogDebug
Regular debug message.
core::Slice< uint8_t > payload
FECFRAME payload.
size_t encoding_symbol_id
The index number of packet in a block ("esi").
size_t source_block_length
Number of source packets in block to which this packet belongs ("sblen").
FecScheme fec_scheme
The FEC scheme to which the packet belongs to.
size_t block_length
Number of source + repair packets in block to which this packet belongs ("blen").
blknum_t source_block_number
Number of a source block in a packet stream ("sbn").