32 m_cm256Valid = m_cm256.isInitialized();
33 connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()),
this, SLOT(handleInputMessages()), Qt::QueuedConnection);
48 qDebug(
"UDPSinkFECWorker::startWork");
63 qDebug(
"UDPSinkFECWorker::stopWork");
75 qDebug(
"UDPSinkFECWorker::process: started");
83 qDebug(
"UDPSinkFECWorker::process: stopped");
113 qDebug(
"UDPSinkFECWorker::handleInputMessages: %s", message->
getIdentifier());
122 qDebug(
"UDPSinkFECWorker::handleInputMessages: MsgStartStop: %s", notif->
getStartStop() ?
"start" :
"stop");
137 CM256::cm256_encoder_params cm256Params;
138 CM256::cm256_block descriptorBlocks[256];
145 for (
unsigned int i = 0;
i < RemoteNbOrginalBlocks;
i++)
155 cm256Params.OriginalCount = RemoteNbOrginalBlocks;
156 cm256Params.RecoveryCount = nbBlocksFEC;
160 for (
int i = 0;
i < cm256Params.OriginalCount + cm256Params.RecoveryCount; ++
i)
162 if (
i >= cm256Params.OriginalCount) {
170 descriptorBlocks[
i].Block = (
void *) &(txBlockx[
i].m_protectedBlock);
175 if (
m_cm256.cm256_encode(cm256Params, descriptorBlocks, fecBlocks))
177 qDebug(
"UDPSinkFECWorker::encodeAndTransmit: CM256 encode failed. No transmission.");
182 for (
int i = 0;
i < cm256Params.RecoveryCount;
i++)
190 for (
int i = 0;
i < cm256Params.OriginalCount + cm256Params.RecoveryCount;
i++)
192 #ifdef REMOTE_PUNCTURE 193 if (
i == REMOTE_PUNCTURE) {
Message * pop()
Pop message from queue.
void push(Message *message, bool emitSignal=true)
Push message onto queue.
QWaitCondition m_startWaiter
static MsgStartStop * create(bool startStop)
bool getStartStop() const
QHostAddress m_remoteHostAddress
void pushTxFrame(RemoteSuperBlock *txBlocks, uint32_t nbBlocksFEC, uint32_t txDelay, uint16_t frameIndex)
static MsgUDPFECEncodeAndSend * create(RemoteSuperBlock *txBlocks, uint32_t nbBlocksFEC, uint32_t txDelay, uint16_t frameIndex)
void encodeAndTransmit(RemoteSuperBlock *txBlockx, uint16_t frameIndex, uint32_t nbBlocksFEC, uint32_t txDelay)
RemoteProtectedBlock m_protectedBlock
uint32_t getNbBlocsFEC() const
void startStop(bool start)
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
MessageQueue m_inputMessageQueue
Queue for asynchronous inbound communication.
void handleInputMessages()
static bool match(const Message *message)
void setRemoteAddress(const QString &address, uint16_t port)
RemoteSuperBlock * getTxBlocks() const
CM256 m_cm256
CM256 library object.
uint16_t getFrameIndex() const
virtual const char * getIdentifier() const
uint32_t getTxDelay() const
bool m_cm256Valid
true if CM256 library is initialized correctly