12 #ifndef ROC_FEC_OPENFEC_DECODER_H_
13 #define ROC_FEC_OPENFEC_DECODER_H_
25 #include <of_openfec_api.h>
28 #ifndef OF_USE_DECODER
29 #error "OF_USE_DECODER undefined"
32 #ifndef OF_USE_LDPC_STAIRCASE_CODEC
33 #error "OF_USE_LDPC_STAIRCASE_CODEC undefined"
60 virtual bool begin(
size_t sblen,
size_t rblen,
size_t payload_size);
76 void update_session_params_(
size_t sblen,
size_t rblen,
size_t payload_size);
79 bool resize_tabs_(
size_t size);
84 bool has_n_packets_(
size_t n_packets)
const;
85 bool is_optimal_()
const;
87 void reset_session_();
88 void destroy_session_();
92 void fix_buffer_(
size_t index);
93 void* make_buffer_(
size_t index);
95 static void* source_cb_(
void* context, uint32_t size, uint32_t index);
96 static void* repair_cb_(
void* context, uint32_t size, uint32_t index);
100 size_t payload_size_;
103 of_codec_id_t codec_id_;
105 of_rs_2_m_parameters_t rs_params_;
106 of_ldpc_parameters ldpc_params_;
110 of_session_t* of_sess_;
111 of_parameters_t* of_sess_params_;
128 bool has_new_packets_;
129 bool decoding_finished_;
131 size_t max_block_length_;
Base class for non-copyable objects.
FEC block decoder interface.
Decoder implementation using OpenFEC library.
virtual void end()
Finish block.
virtual bool begin(size_t sblen, size_t rblen, size_t payload_size)
Start block.
virtual core::Slice< uint8_t > repair(size_t index)
Repair source packet buffer.
virtual void set(size_t index, const core::Slice< uint8_t > &buffer)
Store source or repair packet buffer for current block.
bool is_valid() const
Check if object is successfully constructed.
virtual size_t max_block_length() const
Get the maximum number of encoding symbols for the scheme being used.
OpenfecDecoder(const CodecConfig &config, packet::PacketFactory &packet_factory, core::IArena &arena)
Initialize.
FEC block decoder interface.
Various units used in packets.