我使用三星自带的源码实现MJPEG文件的解码。但是在以下函数中出了问题:
JPEG_ERRORTYPE SsbSipJPEGDecodeExe(int dev_fd)
{
LOG_MSG(LOG_TRACE, "SsbSipJPEGDecodeExe", "jCtx->decParam->fileSize : %d\n", jCtx->decParam->fileSize);
if(jCtx->decParam->decType == JPG_MAIN){
ioctl(dev_fd, IOCTL_JPG_DECODE, jCtx->decParam);
LOG_MSG(LOG_TRACE, "SsbSipJPEGDecodeExe", "decParam->width : %d decParam->height : %d\n", jCtx->decParam->width, jCtx->decParam->height);
LOG_MSG(LOG_TRACE, "SsbSipJPEGDecodeExe", "streamSize : %d\n", jCtx->decParam->dataSize);
}
else {
// thumbnail decode, for the future work.
}
return JPEG_OK;
}
其中decParam->width 等于0,decParam->height等于0,但是,以下函数返回的解码输出缓冲指针不为空
/*----------------------------------------------------------------------------
*Function: SsbSipJPEGGetDecodeInBuf
*Parameters: *openHandle : openhandle from SsbSipJPEGDecodeInit
size : input stream(YUV/RGB) size
*Return Value: virtual address of Decoder input buffer
*Implementation Notes: allocate decoder input buffer
-----------------------------------------------------------------------------*/
void *SsbSipJPEGGetDecodeInBuf(int dev_fd, long size)
{
if(size < 0 || size > MAX_FILE_SIZE){
LOG_MSG(LOG_ERROR, "SsbSipJPEGGetDecodeInBuf", "Invalid Decoder input buffer size\r\n");
return NULL;
}
jCtx->decParam->fileSize = size;
jCtx->InBuf = (char *)ioctl(dev_fd, IOCTL_JPG_GET_STRBUF, jCtx->mappedAddr);
return (jCtx->InBuf);
}
请问这是什么原因,怎么解决?