I have trouble unzipping with zlib and Qt.
I have video-data submitted by Asterix Cat 240 protocol (radar video transmission data) which should be compressed with zlib.
I stored the data inside a QByteArray
and tried to extract it like that:
QByteArray compressedRawVideoDataBlock;
QByteArray rawVideoDataBlock;
QVector <QVector <quint8>> videoDataBlock;
//Video Data
resize(rawAsterix.videoDataBlockREP);
for(int r = 0; r<videoDataBlockREP; r++)//index of Video Block
{
for(int b = 0; b<blockSize ; b++)//index of Video Byte
{
compressedRawVideoDataBlock.append(static_cast<quint8>(buffer->at(i)));
videoDataBlock[r].append(static_cast<quint8>(buffer->at(i)));
i++;
}
}
qDebug() << gzipDecompress(compressedRawVideoDataBlock, rawVideoDataBlock);
For extracting, I tried this function (Zlib QCompressor) but it always returns false and I am not sure why.
Example Data:
videoDataBlockREP=1
blockSize=64
compressedRawVideoDataBlock.toHex() = 7801edd0010d000000c2a0f74f6d0e37884061c0800103060c183060c0800103060c183060c0800103060c183060c0800103060cbc0f0c200000010000000000