23 #include <boost/crc.hpp> 24 #include <boost/cstdint.hpp> 30 m_decoderIndexHead(nbDecoderSlots/2),
34 m_curOriginalBlocks(0),
35 m_minOriginalBlocks(128),
38 m_framesDecoded(true),
59 qDebug() <<
"RemoteInputBuffer::RemoteInputBuffer: cannot initialize CM256 library";
138 int targetPivotIndex = targetPivotSlot *
sizeof(
BufferFrame);
146 dBytes = - normalizedReadIndex - rwDelta;
151 dBytes = bufSize - normalizedReadIndex - rwDelta;
172 int pseudoWriteIndex = slotIndex *
sizeof(
BufferFrame);
187 qDebug() <<
"RemoteInputBuffer::checkSlotData: incomplete frame:" 188 <<
" slotIndex: " << slotIndex
221 if (
m_decoderSlots[decoderIndex].m_blockCount < RemoteNbOrginalBlocks)
233 if (blockIndex < RemoteNbOrginalBlocks)
248 if (
m_decoderSlots[decoderIndex].m_blockCount == RemoteNbOrginalBlocks)
265 qDebug() <<
"RemoteInputBuffer::writeData: decode CM256 error:" 266 <<
" decoderIndex: " << decoderIndex
273 qDebug() <<
"RemoteInputBuffer::writeData: decode CM256 success:" 274 <<
" decoderIndex: " << decoderIndex
289 boost::crc_32_type
crc32;
292 if (crc32.checksum() == metaData->
m_crc32)
295 printMeta(
"RemoteInputBuffer::writeData: recovered meta", metaData);
299 qDebug() <<
"RemoteInputBuffer::writeData: recovered meta: invalid CRC32";
305 qDebug() <<
"RemoteInputBuffer::writeData: recovered block #" << blockIndex;
325 printMeta(
"RemoteInputBuffer::writeData: new meta", metaData);
348 return &buffer[readIndex];
353 return &buffer[readIndex];
369 std::memcpy((
void *) &m_readBuffer[
m_framesNbBytes - m_readIndex], (
const void *) buffer, length);
370 m_readIndex = length;
377 qDebug() << header <<
": "
RemoteProtectedBlock m_protectedBlock
uint32_t crc32(const uint8_t *buf, int len)