AnsweredAssumed Answered

VPU ERR "b or size is zero"

Question asked by Ted Xi on Feb 26, 2018
Latest reply on Mar 5, 2018 by Joan Xie

   我根据mxc_vpu_test和imx vpu文档为imx6写了一个c++ mjpeg解码类,用来给我的mjpeg摄像头解码。我调用vpu_DecGetInitialInfo()函数获取图像的数据时在函数内部报了如下错误[ERR] b or size is zero。请问有没有人知道这意味着什么。

   我的使用VPU操作如下:

   1.调用vpu_Init(NULL);

   2.设置DecOpenParam

    openparam.bitstreamFormat = STD_MJPG;
    openparam.bitstreamBufferSize = buffer_size;
    openparam.bitstreamBuffer = init_mem.phy_addr;
    openparam.mp4DeblkEnable = 0;//for MPEG4 and H.263
    openparam.reorderEnable = 1;//for H.264
    openparam.chromaInterleave = 1;//0 = CbCr not interleaved, 1 = CbCr interleaved
    openparam.mapType = 0;//0 is a linear frame map. 1 is a frame tiled map. 2 is a filed tiled map
    openparam.tiled2LinearEnable = 0;
    openparam.mp4Class = 0;//MPEG4 type 0 = MPEG-4; 1 = DivX 5.0 or higher; 2 = Xvid; 5 = DivX 4.0
    openparam.jpgLineBufferMode = 0;//0 is a LineBuffer mode and 1 is a streaming mode
    openparam.bitstreamMode = 1;//0 interrupt mode, 1 rollback mode

3.调用vpu_DecOpen(&dechandle,&openparam);

4.调用vpu_DecGetBitstreamBuffer();,计算target_addr

5.memcpy((void *)target_addr,(void *)in_data.buff,in_data.length);并且vpu_DecUpdateBitstreamBuffer(dechandle,in_data.length);

6.vpu_DecGiveCommand(dechandle,DEC_SET_REPORT_USERDATA, &userData);//我看见实例里面无论userData.enable是否为1都会执行,我索性就也写了这一句,虽然我不知道这有什么用,但是不论我是否执行都报相同的错误

7.调用

    vpu_DecSetEscSeqInit(dechandle, 1);
    ret = vpu_DecGetInitialInfo(dechandle, &initinfo);
    vpu_DecSetEscSeqInit(dechandle, 0);

在vpu_DecGetInitialInfo()函数中报了[ERR] b or size is zero错误。

返回值为RETCODE_SUCCESS。

   在后面从结构体中获得的图像长宽,图像格式等参数都为0,但streamInfoObtained为1。

我输出的调试信息如下图:VPU执行信息

我确定我摄像头捕获的图像没有问题

   我摄像头分辨率设置为1280*720。我使用tcp将摄像头得到的图像传到电脑上可以解码并且正确现实。

                                                                                                                                                                        谢谢

Outcomes