29 #include "cm256cc/cm256.h" 36 m_address(QHostAddress::LocalHost),
40 m_cm256p = m_cm256.isInitialized() ? &m_cm256 : 0;
41 connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()),
this, SLOT(handleInputMessages()), Qt::QueuedConnection);
46 qDebug(
"RemoteSinkThread::~RemoteSinkThread");
57 qDebug(
"RemoteSinkThread::startWork");
68 qDebug(
"RemoteSinkThread::stopWork");
77 qDebug(
"RemoteSinkThread::run: begin");
87 qDebug(
"RemoteSinkThread::run: end");
98 CM256::cm256_encoder_params cm256Params;
99 CM256::cm256_block descriptorBlocks[256];
109 if ((nbBlocksFEC == 0) || !
m_cm256p)
113 for (
int i = 0;
i < RemoteNbOrginalBlocks;
i++)
116 m_socket->writeDatagram((
const char*)&txBlockx[
i], (qint64 ) RemoteUdpSize,
m_address, dataPort);
124 cm256Params.OriginalCount = RemoteNbOrginalBlocks;
125 cm256Params.RecoveryCount = nbBlocksFEC;
128 for (
int i = 0;
i < cm256Params.OriginalCount + cm256Params.RecoveryCount; ++
i)
130 if (
i >= cm256Params.OriginalCount) {
138 descriptorBlocks[
i].Block = (
void *) &(txBlockx[
i].m_protectedBlock);
143 if (
m_cm256p->cm256_encode(cm256Params, descriptorBlocks, fecBlocks))
145 qWarning(
"RemoteSinkThread::handleDataBlock: CM256 encode failed. No transmission.");
150 for (
int i = 0;
i < cm256Params.RecoveryCount;
i++)
158 for (
int i = 0;
i < cm256Params.OriginalCount + cm256Params.RecoveryCount;
i++)
161 m_socket->writeDatagram((
const char*)&txBlockx[
i], (qint64 ) RemoteUdpSize,
m_address, dataPort);
179 qDebug(
"RemoteSinkThread::handleInputMessages: MsgStartStop: %s", notif->
getStartStop() ?
"start" :
"stop");
Message * pop()
Pop message from queue.
void push(Message *message, bool emitSignal=true)
Push message onto queue.
RemoteSuperBlock * m_superBlocks
RemoteProtectedBlock m_protectedBlock
static MsgStartStop * create(bool startStop)
bool getStartStop() const
MessageQueue m_inputMessageQueue
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
void handleDataBlock(RemoteDataBlock &dataBlock)
QWaitCondition m_startWaiter
static bool match(const Message *message)
RemoteTxControlBlock m_txControlBlock
void startStop(bool start)
void handleInputMessages()
void processDataBlock(RemoteDataBlock *dataBlock)